aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-03-04 12:52:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-04 19:47:38 +0100
commit1c451b40aee66a38ca3d61e5beec4ae8c986c8ed (patch)
tree4487c7bf216e2a7b02385ed1ff21f8607424551b /tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
parent3e0dc9ef3894c39fc617c96eecbd419a7a2fefa4 (diff)
pressedCanceledOnWindowDeactivate pops up a second window
in order to cause the first one to be deactivated. Task-number: QTBUG-29953 Change-Id: I7fec66b07976b2afc78941d39c593f99ea484522 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp')
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index 327abbebd5..6ee79b06a2 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -583,16 +583,14 @@ void tst_QQuickMouseArea::pressedCanceledOnWindowDeactivate()
QVERIFY(!window->rootObject()->property("canceled").toBool());
QVERIFY(!window->rootObject()->property("released").toBool());
- QTest::qWait(200);
+ QWindow *secondWindow = qvariant_cast<QWindow*>(window->rootObject()->property("secondWindow"));
+ secondWindow->setProperty("visible", true);
+ QTest::qWaitForWindowActive(secondWindow);
- QEvent windowDeactivateEvent(QEvent::WindowDeactivate);
- QGuiApplication::sendEvent(window, &windowDeactivateEvent);
QVERIFY(!window->rootObject()->property("pressed").toBool());
QVERIFY(window->rootObject()->property("canceled").toBool());
QVERIFY(!window->rootObject()->property("released").toBool());
- QTest::qWait(200);
-
//press again
QGuiApplication::sendEvent(window, &pressEvent);
QVERIFY(window->rootObject()->property("pressed").toBool());