summaryrefslogtreecommitdiffstats
path: root/tests/manual/windowflags/controllerwindow.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2025-02-20 12:32:21 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2025-03-17 20:14:01 +0000
commitd56dbdd48cb6149b6697b1e695ee7e2de1151bee (patch)
tree37479b17997aab5eda6709c9c344bafbf6c0c7f2 /tests/manual/windowflags/controllerwindow.cpp
parent1750acc3921148b0ffc8f9f1421b87a2f5522a2e (diff)
windowflags manual test: Add option to force window recreation
Not all flags have an affect on an already created window, depending on the platform and existing flags. Add option to force recreating the window. To aid debugging we also now log platform destruction/recreation events. Pick-to: 6.9 Change-Id: I7822cb58eaed51d72ed4ea3244f1f4113964cff7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tests/manual/windowflags/controllerwindow.cpp')
-rw-r--r--tests/manual/windowflags/controllerwindow.cpp9
1 files changed, 9 insertions, 0 deletions
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;