diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index 5823bc5360e..a3710d031e1 100644 --- a/tests/manual/windowflags/controllerwindow.cpp +++ b/tests/manual/windowflags/controllerwindow.cpp @@ -79,6 +79,9 @@ void ControllerWidget::updatePreview(PreviewWindow *preview) { activePreview = preview; + if (recreateCheckbox->isChecked()) + activePreview->destroy(); + const Qt::WindowFlags flags = typeControl->type() | hintsControl->hints(); if (modalWindowCheckBox->isChecked()) { @@ -112,6 +115,9 @@ void ControllerWidget::updatePreview(QWidget *preview) { activePreview = preview->windowHandle(); + if (activePreview && recreateCheckbox->isChecked()) + activePreview->destroy(); + const Qt::WindowFlags flags = typeControl->type() | hintsControl->hints(); if (modalWindowCheckBox->isChecked()) { @@ -176,9 +182,11 @@ void ControllerWidget::createTypeGroupBox() modalWindowCheckBox = createCheckBox(tr("Modal window")); fixedSizeWindowCheckBox = createCheckBox(tr("Fixed size window")); safeAreaCheckBox = createCheckBox(tr("Visualize safe areas")); + recreateCheckbox = createCheckBox(tr("Recreate on update")); l->addWidget(modalWindowCheckBox); l->addWidget(fixedSizeWindowCheckBox); l->addWidget(safeAreaCheckBox); + l->addWidget(recreateCheckbox); additionalOptionsGroupBox->setLayout(l); } @@ -230,6 +238,7 @@ public: case QEvent::ApplicationActivate: case QEvent::ApplicationDeactivate: case QEvent::ApplicationStateChange: + case QEvent::PlatformSurface: if (isTopLevel(o)) formatEvent(o, e); break; diff --git a/tests/manual/windowflags/controllerwindow.h b/tests/manual/windowflags/controllerwindow.h index 8a0a1ee4710..56634aa0e53 100644 --- a/tests/manual/windowflags/controllerwindow.h +++ b/tests/manual/windowflags/controllerwindow.h @@ -61,6 +61,7 @@ private: QCheckBox *modalWindowCheckBox; QCheckBox *fixedSizeWindowCheckBox; QCheckBox *safeAreaCheckBox; + QCheckBox *recreateCheckbox; }; class LogWidget : public QPlainTextEdit