diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-02-10 15:57:11 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-02-13 18:30:06 +0000 |
commit | 09e7a994d14a0582912551ca1342e3b695cf3a86 (patch) | |
tree | 1b1cb309115db137e6c14b2ffcee19774ad6f8a9 /tests | |
parent | 9bf8cc1f185d3d39446a6911f4a694f274bb94c3 (diff) |
Don't create platform window for QWindows when calling setVisible(false)
We can defer the creation until the window is shown.
Change-Id: I3d5b45ae59ee0925996cf12cd46dd574c8c6ef95
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 4fc18be3d2..36ec28de8d 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -56,6 +56,7 @@ private slots: void create(); void setParent(); void setVisible(); + void setVisibleFalseDoesNotCreateWindow(); void eventOrderOnShow(); void resizeEventAfterResize(); void exposeEventOnShrink_QTBUG54040(); @@ -234,6 +235,16 @@ void tst_QWindow::setVisible() QVERIFY(QTest::qWaitForWindowExposed(&i)); } +void tst_QWindow::setVisibleFalseDoesNotCreateWindow() +{ + QWindow w; + QVERIFY(!w.handle()); + w.setVisible(false); + QVERIFY2(!w.handle(), "Hiding a non-created window doesn't create it"); + w.setVisible(true); + QVERIFY2(w.handle(), "Showing a non-created window creates it"); +} + void tst_QWindow::mapGlobal() { QWindow a; |