Update QMdiSubWindow after windowFlags were changed

Adding or removing close/maximize/minimize buttons to an already
existing QMdiSubWindow is only visible after the window is repainted.
This patch repaints the QMdiSubWindow at the end of setWindowFlags.

Fixes: QTBUG-125778
Pick-to: 6.7
Change-Id: Ibdf136621bf70337a2af29dfcfd10b60dde11e15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6520ed0f2567c5a8fd680dccbff59c5ef8fc89c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wladimir Leuschner 2024-07-31 13:54:32 +02:00 committed by Qt Cherry-pick Bot
parent e7aa8aa118
commit c561b7197b

View File

@ -2095,6 +2095,7 @@ void QMdiSubWindowPrivate::setVisible(WindowStateAction action, bool visible)
(controlContainer->controllerWidget())) {
ctrlWidget->setControlVisible(action, visible);
}
q->update();
}
#ifndef QT_NO_ACTION
@ -2867,6 +2868,13 @@ bool QMdiSubWindow::event(QEvent *event)
showToolTip(static_cast<QHelpEvent *>(event), this, d->titleBarOptions(),
QStyle::CC_TitleBar, d->hoveredSubControl);
break;
#endif
#ifndef QT_NO_ACTION
case QEvent::ActionAdded:
case QEvent::ActionChanged:
case QEvent::ActionRemoved:
update();
break;
#endif
default:
break;