Skip to content

Commit 691c968

Browse files
committed
Merge branch 'master' into Central-Widget
2 parents 1a11e5d + a4d281d commit 691c968

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/DockAreaWidget.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ class CDockAreaLayout
8686

8787
}
8888

89+
/**
90+
* Delete widgets without parents in this layout
91+
*/
92+
~CDockAreaLayout()
93+
{
94+
for(auto Widget : m_Widgets)
95+
{
96+
if(!Widget->parent())
97+
delete Widget;
98+
}
99+
}
100+
89101
/**
90102
* Returns the number of widgets in this layout
91103
*/
@@ -467,6 +479,14 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
467479
ADS_PRINT("Dock Area empty");
468480
DockContainer->removeDockArea(this);
469481
this->deleteLater();
482+
if(DockContainer->dockAreaCount() == 0)
483+
{
484+
if(CFloatingDockContainer* FloatingDockContainer = DockContainer->floatingWidget())
485+
{
486+
FloatingDockContainer->hide();
487+
FloatingDockContainer->deleteLater();
488+
}
489+
}
470490
}
471491
else if (DockWidget == CurrentDockWidget)
472492
{

src/DockManager.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,14 @@ void CDockManager::showEvent(QShowEvent *event)
654654

655655
for (auto FloatingWidget : d->UninitializedFloatingWidgets)
656656
{
657-
FloatingWidget->show();
657+
for(CDockWidget* DockWidget : FloatingWidget->dockWidgets())
658+
{
659+
if(!DockWidget->isClosed())
660+
{
661+
FloatingWidget->show();
662+
break;
663+
}
664+
}
658665
}
659666
d->UninitializedFloatingWidgets.clear();
660667
}

0 commit comments

Comments
 (0)