diff options
author | Tomi Korpipää <tomi.korpipaa@qt.io> | 2024-02-27 10:21:12 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2024-02-27 18:43:14 +0200 |
commit | f429f12a7fb94ef5970a28eaf0b53aea935044b3 (patch) | |
tree | 4ccbb3a82d252d8f79ab6189b064d34652bb84a6 /src/widgets/widgets | |
parent | a680838be4cf9eee44d7977722cd5acf3422f5ad (diff) |
Prevent re-replacing state in setGeometry
Do not allow replacing a state again if it is already being replaced.
Cleaned up from the patch provided in QTBUG-121126.
Fixes: QTBUG-121126
Pick-to: 6.6 6.7
Change-Id: Icca932b0e5cccd2f39ac18f29d8f7707887d147f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 246471dc2c..3933f2a7cd 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -2230,7 +2230,9 @@ void QMainWindowLayout::applyRestoredState() void QMainWindowLayout::setGeometry(const QRect &_r) { - if (savedState.isValid()) + // Check if the state is valid, and avoid replacing it again if it is currently used + // in applyState + if (savedState.isValid() || (restoredState && isInApplyState)) return; QRect r = _r; |