diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-04-24 15:03:36 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-04-25 13:39:24 +0000 |
commit | 29b012eb0f913eac724afcb4e1b14a6d71492ff6 (patch) | |
tree | 33d868acde2f534bd42db473977020035d318e2c /src/widgets/widgets/qmainwindowlayout.cpp | |
parent | d50d35d9db698f13aaf98a118713a4a1c74d1bd4 (diff) |
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 ba2221bd7314c42353cd7ab2895c043d06d837ac.
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>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 0297172100..0082ce291e 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -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) |