Fix crash in QMainWindow::tabifyDockWidgets()

The list of tab bars in QMainWindowLayout::animationFinished()
is apparently modified by animations. Take a copy before
iterating over it and showing the tab bars.

Amends ba2221bd73.

Task-number: QTBUG-67916
Change-Id: Ib3a70eeac1f3b3f0dd7bd5d37aa6c34b92a55086
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
bb10
Friedemann Kleint 2018-04-24 15:03:36 +02:00 committed by Simon Hausmann
parent d50d35d9db
commit 29b012eb0f
1 changed files with 2 additions and 1 deletions

View File

@ -2251,7 +2251,8 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
#if QT_CONFIG(dockwidget)
parentWidget()->update(layoutState.dockAreaLayout.separatorRegion());
#if QT_CONFIG(tabbar)
for (QTabBar *tab_bar : qAsConst(usedTabBars))
const auto usedTabBarsCopy = usedTabBars; // list potentially modified by animations
for (QTabBar *tab_bar : usedTabBarsCopy)
tab_bar->show();
#endif // QT_CONFIG(tabbar)
#endif // QT_CONFIG(dockwidget)