File tree Expand file tree Collapse file tree 1 file changed +7
-21
lines changed Expand file tree Collapse file tree 1 file changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -334,27 +334,13 @@ void CDockAreaTabBar::onTabCloseRequested()
334334void CDockAreaTabBar::onCloseOtherTabsRequested ()
335335{
336336 auto Sender = qobject_cast<CDockWidgetTab*>(sender ());
337- for (int i = 0 ; i < count (); ++i)
338- {
339- auto Tab = tab (i);
340- if (Tab->isClosable () && !Tab->isHidden () && Tab != Sender)
341- {
342- // If the dock widget is deleted with the closeTab() call, its tab
343- // it will no longer be in the layout, and thus the index needs to
344- // be updated to not skip any tabs
345- int Offset = Tab->dockWidget ()->features ().testFlag (
346- CDockWidget::DockWidgetDeleteOnClose) ? 1 : 0 ;
347- closeTab (i);
348-
349- // If the dock widget blocks closing, i.e. if the flag
350- // CustomCloseHandling is set, and the dock widget is still open,
351- // then we do not need to correct the index
352- if (Tab->dockWidget ()->isClosed ())
353- {
354- i -= Offset;
355- }
356- }
357- }
337+
338+ for (int i = count () - 1 ; i >= 0 ; --i) {
339+ auto Tab = tab (i);
340+ if (Tab->isClosable () && !Tab->isHidden () && Tab != Sender) {
341+ closeTab (i);
342+ }
343+ }
358344}
359345
360346
You can’t perform that action at this time.
0 commit comments