Add explanation to tst_QQuickMouseArea::moveAndReleaseWithoutPress
The test makes sure that no events are delivered after the initial press is released. In this context QTRY_* makes little sense, since we are confirming that the defaults have not changed. Thus rather spin the event loop 11 times and hope that if we would accidentally deliver events that we shouldn't, it will be caught in that time. Change-Id: Iadeed07a81978aa6679e5513c1fe0aebcaeeb997 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
9ae9d5500c
commit
6349a08f39
|
@ -1740,11 +1740,17 @@ void tst_QQuickMouseArea::moveAndReleaseWithoutPress()
|
|||
|
||||
QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(100,100));
|
||||
|
||||
// the press was not accepted, make sure there is no move or release event
|
||||
QTest::mouseMove(&window, QPoint(110,110), 50);
|
||||
QTRY_COMPARE(root->property("hadMove").toBool(), false);
|
||||
|
||||
// use qwait here because we want to make sure an event does NOT happen
|
||||
// the test fails if the default state changes, while it shouldn't
|
||||
QTest::qWait(100);
|
||||
QCOMPARE(root->property("hadMove").toBool(), false);
|
||||
|
||||
QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(110,110));
|
||||
QTRY_COMPARE(root->property("hadRelease").toBool(), false);
|
||||
QTest::qWait(100);
|
||||
QCOMPARE(root->property("hadRelease").toBool(), false);
|
||||
}
|
||||
|
||||
void tst_QQuickMouseArea::nestedStopAtBounds_data()
|
||||
|
|
Loading…
Reference in New Issue