diff --git a/src/AutoHideDockContainer.cpp b/src/AutoHideDockContainer.cpp index 7e8bae4..ed1c5c6 100644 --- a/src/AutoHideDockContainer.cpp +++ b/src/AutoHideDockContainer.cpp @@ -103,7 +103,6 @@ struct AutoHideDockContainerPrivate CAutoHideDockContainer* _this; CDockAreaWidget* DockArea{nullptr}; CDockWidget* DockWidget{nullptr}; - QPointer DockManager{nullptr}; SideBarLocation SideTabBarArea; QBoxLayout* Layout; CResizeHandle* ResizeHandle = nullptr; @@ -172,7 +171,6 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockManager* DockManager, SideBa Super(parent), d(new AutoHideDockContainerPrivate(this)) { - d->DockManager = DockManager; d->SideTabBarArea = area; d->DockArea = new CDockAreaWidget(DockManager, parent); d->DockArea->setObjectName("autoHideDockArea"); @@ -254,7 +252,7 @@ CAutoHideDockContainer::~CAutoHideDockContainer() // Remove event filter in case there are any queued messages qApp->removeEventFilter(this); - if (d->DockManager) + if (parentContainer()) { parentContainer()->removeAutoHideWidget(this); } @@ -424,7 +422,7 @@ void CAutoHideDockContainer::collapseView(bool Enable) d->updateResizeHandleSizeLimitMax(); raise(); show(); - d->DockManager->setDockWidgetFocused(d->DockWidget); + d->DockWidget->dockManager()->setDockWidgetFocused(d->DockWidget); qApp->installEventFilter(this); } diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 3fb36e2..35ed4fb 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -1065,17 +1065,17 @@ bool DockContainerWidgetPrivate::restoreAutoHideDockArea(CDockingStateReader& s, } CDockAreaWidget* DockArea = nullptr; - CAutoHideDockContainer* dockContainer = nullptr; + CAutoHideDockContainer* AutoHideContainer = nullptr; if (!Testing) { - dockContainer = new CAutoHideDockContainer(DockManager, area, _this); - if (!dockContainer->restoreState(s, Testing)) + AutoHideContainer = new CAutoHideDockContainer(DockManager, area, _this); + if (!AutoHideContainer->restoreState(s, Testing)) { return false; } - dockContainer->hide(); - DockArea = dockContainer->dockAreaWidget(); + AutoHideContainer->hide(); + DockArea = AutoHideContainer->dockAreaWidget(); DockArea->updateAutoHideButtonCheckState(); DockArea->updateTitleBarButtonToolTip(); } @@ -1120,9 +1120,9 @@ bool DockContainerWidgetPrivate::restoreAutoHideDockArea(CDockingStateReader& s, DockArea->autoHideDockContainer()->toggleView(!Closed); } - if (dockContainer && !dockContainer->dockWidget()) + if (AutoHideContainer && !AutoHideContainer->dockWidget()) { - dockContainer->cleanupAndDelete(); + AutoHideContainer->cleanupAndDelete(); } return true;