Implemented custom close handling

This commit is contained in:
Uwe Kindler
2020-01-06 11:42:36 +01:00
parent 0305d8a221
commit a5e8011222
10 changed files with 449 additions and 376 deletions

View File

@@ -478,7 +478,14 @@ void CDockAreaTabBar::onCloseOtherTabsRequested()
int Offset = Tab->dockWidget()->features().testFlag(
CDockWidget::DockWidgetDeleteOnClose) ? 1 : 0;
closeTab(i);
i -= Offset;
// If the the dock widget blocks closing, i.e. if the flag
// CustomCloseHandling is set, and the dock widget is still open,
// then we do not need to correct the index
if (Tab->dockWidget()->isClosed())
{
i -= Offset;
}
}
}
}
@@ -569,7 +576,7 @@ void CDockAreaTabBar::closeTab(int Index)
{
return;
}
Tab->hide();
//Tab->hide();
emit tabCloseRequested(Index);
}