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>
bb10
Tomi Korpipää 2024-02-27 10:21:12 +02:00
parent a680838be4
commit f429f12a7f
1 changed files with 3 additions and 1 deletions

View File

@ -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;