Fixed problem with CDockAreaTabBar::onCloseOtherTabsRequested() if DockWidgets support the DockwidgetDeleteOnClose flag, enhanced demo to enabled creation of dynamic tables

This commit is contained in:
Uwe Kindler
2019-12-11 15:50:13 +01:00
parent 05f8ce15a2
commit a45a035bb3
5 changed files with 70 additions and 11 deletions

View File

@@ -449,7 +449,13 @@ void CDockAreaTabBar::onCloseOtherTabsRequested()
auto Tab = tab(i);
if (Tab->isClosable() && !Tab->isHidden() && Tab != Sender)
{
// If the dock widget is deleted with the closeTab() call, its tab
// it will no longer be in the layout, and thus the index needs to
// be updated to not skip any tabs
int Offset = Tab->dockWidget()->features().testFlag(
CDockWidget::DockWidgetDeleteOnClose) ? 1 : 0;
closeTab(i);
i -= Offset;
}
}
}