Fixed problem with CDockAreaTabBar::onCloseOtherTabsRequested() if DockWidgets support the DockwidgetDeleteOnClose flag, enhanced demo to enabled creation of dynamic tables
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user