From c28a27c81ca8b2d01a2c9ba76568e51d9025cb6c Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Mon, 24 Aug 2020 13:22:34 +0200 Subject: [PATCH] Reverted changes that cause application crash --- src/DockAreaWidget.cpp | 14 ++------------ src/DockManager.cpp | 15 +-------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 78c4e5e..98055e8 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -86,18 +86,6 @@ public: } - /** - * Delete widgets without parents in this layout - */ - ~CDockAreaLayout() - { - for(auto Widget : m_Widgets) - { - if(!Widget->parent()) - delete Widget; - } - } - /** * Returns the number of widgets in this layout */ @@ -977,7 +965,9 @@ QSize CDockAreaWidget::minimumSizeHint() const void CDockAreaWidget::onDockWidgetFeaturesChanged() { if (d->TitleBar) + { d->updateTitleBarButtonStates(); + } } diff --git a/src/DockManager.cpp b/src/DockManager.cpp index f75ff71..95e4fac 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -484,12 +484,6 @@ CDockManager::~CDockManager() { delete FloatingWidget; } - auto DockWidgetsMap = d->DockWidgetsMap; - for(auto DockWidget : d->DockWidgetsMap) - { - if(!DockWidget->parent()) - delete DockWidget; - } delete d; } @@ -659,14 +653,7 @@ void CDockManager::showEvent(QShowEvent *event) for (auto FloatingWidget : d->UninitializedFloatingWidgets) { - for(CDockWidget* DockWidget : FloatingWidget->dockWidgets()) - { - if(!DockWidget->isClosed()) - { - FloatingWidget->show(); - break; - } - } + FloatingWidget->show(); } d->UninitializedFloatingWidgets.clear(); }