summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 87c33932a8d..a1a4cfc2ce0 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -2673,8 +2673,10 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
parentWidget()->update(layoutState.dockAreaLayout.separatorRegion());
#if QT_CONFIG(tabbar)
const auto usedTabBarsCopy = usedTabBars; // list potentially modified by animations
- for (QTabBar *tab_bar : usedTabBarsCopy)
- tab_bar->show();
+ for (QTabBar *tab_bar : usedTabBarsCopy) {
+ if (usedTabBars.contains(tab_bar)) // Showing a tab bar can cause another to be deleted.
+ tab_bar->show();
+ }
#endif // QT_CONFIG(tabbar)
#endif // QT_CONFIG(dockwidget)
}