Merge branch 'master' into Central-Widget

This commit is contained in:
hulswit 2020-08-20 16:37:05 +02:00
commit 691c9683ce
2 changed files with 28 additions and 1 deletions

View File

@ -86,6 +86,18 @@ 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
*/
@ -467,6 +479,14 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
ADS_PRINT("Dock Area empty");
DockContainer->removeDockArea(this);
this->deleteLater();
if(DockContainer->dockAreaCount() == 0)
{
if(CFloatingDockContainer* FloatingDockContainer = DockContainer->floatingWidget())
{
FloatingDockContainer->hide();
FloatingDockContainer->deleteLater();
}
}
}
else if (DockWidget == CurrentDockWidget)
{

View File

@ -654,7 +654,14 @@ void CDockManager::showEvent(QShowEvent *event)
for (auto FloatingWidget : d->UninitializedFloatingWidgets)
{
FloatingWidget->show();
for(CDockWidget* DockWidget : FloatingWidget->dockWidgets())
{
if(!DockWidget->isClosed())
{
FloatingWidget->show();
break;
}
}
}
d->UninitializedFloatingWidgets.clear();
}