From 6b85b2b505839688d0ecb49b272913cb800f5fbc Mon Sep 17 00:00:00 2001 From: Syarif Fakhri Date: Wed, 14 Sep 2022 12:32:32 +0800 Subject: [PATCH] Revert "Fix crash when restoring state" This reverts commit ee97b03e5336a085f6c868800a79b124f606fc76. --- src/DockContainerWidget.cpp | 1 - src/OverlayDockContainer.cpp | 34 ++++------------------------------ src/OverlayDockContainer.h | 6 ------ 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 77f2d09..bcf53bd 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -1666,7 +1666,6 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area) CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true); dumpLayout(); d->emitDockAreasRemoved(); - area->overlayDockContainer()->clearDockArea(); area->setOverlayDockContainer(nullptr); area->updateAutoHideButtonCheckState(); area->updateTitleBarButtonToolTip(); diff --git a/src/OverlayDockContainer.cpp b/src/OverlayDockContainer.cpp index cec961d..1aca25e 100644 --- a/src/OverlayDockContainer.cpp +++ b/src/OverlayDockContainer.cpp @@ -158,11 +158,6 @@ COverlayDockContainer::COverlayDockContainer(CDockManager* DockManager, CDockWid //============================================================================ void COverlayDockContainer::updateMask() { - if (d->DockArea == nullptr) - { - return; - } - const auto rect = d->DockArea->frameGeometry(); const auto topLeft = rect.topLeft(); const auto handleSize = d->Splitter->handleWidth(); @@ -227,8 +222,6 @@ CDockWidget* COverlayDockContainer::dockWidget() const //============================================================================ void COverlayDockContainer::addDockWidget(CDockWidget* DockWidget) { - Q_ASSERT_X(d->DockArea != nullptr, "COverlayDockContainer::addDockWidget", "You should not be using the overlay dock container after the dock area is set to nullptr."); - if (d->DockWidget) { // Remove the old dock widget at this area @@ -391,26 +384,14 @@ void COverlayDockContainer::collapseView(bool Enable) if (Enable) { hide(); - if (d->DockArea) - { - d->DockArea->hide(); - } - if (d->DockWidget) - { - d->DockWidget->hide(); - } + d->DockArea->hide(); + d->DockWidget->hide(); } else { show(); - if (d->DockArea) - { - d->DockArea->show(); - } - if (d->DockWidget) - { - d->DockWidget->show(); - } + d->DockArea->show(); + d->DockWidget->show(); } } @@ -438,13 +419,6 @@ bool COverlayDockContainer::areaExistsInConfig(CDockWidgetSideTab::SideTabBarAre } -//============================================================================ -void COverlayDockContainer::clearDockArea() -{ - d->DockArea = nullptr; -} - - //============================================================================ bool COverlayDockContainer::eventFilter(QObject* watched, QEvent* event) { diff --git a/src/OverlayDockContainer.h b/src/OverlayDockContainer.h index e9d9fa9..175a1b8 100644 --- a/src/OverlayDockContainer.h +++ b/src/OverlayDockContainer.h @@ -150,12 +150,6 @@ public: * Convenience function fr determining if area exists in config */ static bool areaExistsInConfig(CDockWidgetSideTab::SideTabBarArea area); - - /** - * Sets internal DockArea to nullptr - * Called when removing the dock area from this overlay widget - */ - void clearDockArea(); }; }