diff options
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 60db982cb7..f7dcd036f0 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -2788,6 +2788,12 @@ QDockWidgetGroupWindow *QMainWindowLayout::createTabbedDockWindow() void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animate) { + // applying the state can lead to showing separator widgets, which would lead to a re-layout + // (even though the separator widgets are not really part of the layout) + // break the loop + if (isInApplyState) + return; + isInApplyState = true; #if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget) QSet<QTabBar*> used = newState.dockAreaLayout.usedTabBars(); const auto groups = @@ -2810,6 +2816,7 @@ void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animat usedSeparatorWidgets = usedSeps; for (QWidget *sepWidget : retiredSeps) { unusedSeparatorWidgets.append(sepWidget); + sepWidget->hide(); } } @@ -2818,6 +2825,7 @@ void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animat #endif // QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget) newState.apply(dockOptions & QMainWindow::AnimatedDocks && animate); + isInApplyState = false; } void QMainWindowLayout::saveState(QDataStream &stream) const |