Fixed some issues with custom close handling

This commit is contained in:
Uwe Kindler
2020-01-14 12:43:42 +01:00
parent 9af9e43a5d
commit 407af06a4a
3 changed files with 16 additions and 7 deletions

View File

@@ -770,6 +770,21 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
if (features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
{
// If the dock widget is floating, then we check if we also need to
// delete the floating widget
if (isFloating())
{
CFloatingDockContainer* FloatingWidget = internal::findParent<
CFloatingDockContainer*>(this);
if (FloatingWidget->dockWidgets().count() == 1)
{
FloatingWidget->deleteLater();
}
else
{
FloatingWidget->hide();
}
}
deleteDockWidget();
}
else