From 637b6e1097500235ca2146ae706b52ed9fc0effc Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 8 Apr 2014 17:01:01 +0200 Subject: Ignore the fullscreen state of a QMdiSubWindow On some platforms all windows are by default forced into fullscreen mode when show() is executed. In QMdiSubWindow we cannot handle the fullscreen state and should ignore it. Otherwise the window will be forced in "normal" state and ignore any previously executed geometry changes. Change-Id: I09ce6507a1eac6a0adb3405ca3f423642d30f801 Reviewed-by: Friedemann Kleint Reviewed-by: Marc Mutz Reviewed-by: Bernd Weimer --- .../widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp') diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index 268638a504..ffc3e3b67d 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -206,6 +206,7 @@ private slots: void task_233197(); void task_226929(); void styleChange(); + void testFullScreenState(); }; void tst_QMdiSubWindow::initTestCase() @@ -2007,6 +2008,19 @@ void tst_QMdiSubWindow::styleChange() QCOMPARE(spy.count(), 0); } +void tst_QMdiSubWindow::testFullScreenState() +{ + QMdiArea mdiArea; + mdiArea.showMaximized(); + + QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget); + subWindow->setGeometry(0, 0, 300, 300); + subWindow->showFullScreen(); // QMdiSubWindow does not support the fullscreen state. This call + // should be equivalent to setVisible(true) (and not showNormal()) + QVERIFY(QTest::qWaitForWindowExposed(&mdiArea)); + QCOMPARE(subWindow->size(), QSize(300, 300)); +} + QTEST_MAIN(tst_QMdiSubWindow) #include "tst_qmdisubwindow.moc" -- cgit v1.2.3