summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-06-14 11:52:09 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-06-28 09:07:28 +0000
commitb0e4c8f427eaed8ce392be95e08913d2efe1d3a2 (patch)
tree7fb96c379be457fb320828788973d84af2e3f6ee /tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
parent84cc43413a8577245701e6890d821e3c701a2fb1 (diff)
Remove requirement to call QWindow::setMask after creating window
Like other QWindow properties we can just store it, and the platform window should pick it up on creation like other properties. [ChangeLog][QtGui][QWindow] setMask() no longer requires the window to be created to have an effect; it can be set at any time. Change-Id: I55b616363801b770bd61bda5325b443013b99866 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 4cccf08086..2d32876a8d 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -1786,16 +1786,27 @@ void tst_QWindow::mask()
{
QRegion mask = QRect(10, 10, 800 - 20, 600 - 20);
- QWindow window;
- window.resize(800, 600);
- window.setMask(mask);
+ {
+ QWindow window;
+ window.resize(800, 600);
+ QCOMPARE(window.mask(), QRegion());
- QCOMPARE(window.mask(), QRegion());
+ window.create();
+ window.setMask(mask);
+ QCOMPARE(window.mask(), mask);
+ }
- window.create();
- window.setMask(mask);
+ {
+ QWindow window;
+ window.resize(800, 600);
+ QCOMPARE(window.mask(), QRegion());
+
+ window.setMask(mask);
+ QCOMPARE(window.mask(), mask);
+ window.create();
+ QCOMPARE(window.mask(), mask);
+ }
- QCOMPARE(window.mask(), mask);
}
void tst_QWindow::initialSize()