QMdiArea: Do not reset tiled flag on spontaneous system window events

Do not reset the isSubWindowsTiled flag if the hide/show event is an
external (spontaneous) system window event, i.e. we should instead
reset this flag when the subwindow itself is directly hidden or
shown. This change ensures that tiling will be performed during the
resizeEvent after an application window minimize (hide) and then
restore (show).

Change-Id: Ib37f52f1162b493be3413fc59951be2f30701439
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Nick D'Ademo 2018-11-05 15:13:19 +08:00
parent ec5e692c1c
commit 4744f31e59
1 changed files with 5 additions and 1 deletions

View File

@ -2640,7 +2640,11 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
#endif // QT_CONFIG(tabbar)
Q_FALLTHROUGH();
case QEvent::Hide:
d->isSubWindowsTiled = false;
// Do not reset the isSubWindowsTiled flag if the event is a spontaneous system window event.
// This ensures that tiling will be performed during the resizeEvent after an application
// window minimize (hide) and then restore (show).
if (!event->spontaneous())
d->isSubWindowsTiled = false;
break;
#if QT_CONFIG(rubberband)
case QEvent::Close: