aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/pointerhandlers
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@qt.io>2018-02-02 10:45:06 +0100
committerJan Arve Sæther <jan-arve.saether@qt.io>2018-02-02 12:45:20 +0000
commit5bcbba1312ac91f7b9f23e7a1574225e190bded4 (patch)
treed04205679608087c4283b34d1a26ad5661aa24bf /tests/auto/quick/pointerhandlers
parent2e65f6c2a5d84f4369245cabdc03eca4c19851f0 (diff)
Make sure passive grabbers are cleared on release
This got regressed by change e6d4df156e9aec62054740dc99ab8ba2855eaafc. Before that change, we always cleared both the exclusive and passive grabbers. Task-number: QTBUG-66152 Change-Id: I93d2568bd2a23ddd55a5294d544f978a50a5543e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers')
-rw-r--r--tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp
index 7862d72db8..c0b34f8246 100644
--- a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp
+++ b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp
@@ -544,6 +544,20 @@ void tst_FlickableInterop::mouseDragFlickableBehindItemWithHandlers()
QCOMPARE(originP1 + QPoint(3*dragThreshold, 0), p1);
}
QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, p1);
+ // wait until flickable stops
+ QTRY_COMPARE(flickable->isMoving(), false);
+
+ // After the mouse button has been released, move the mouse and ensure that nothing is moving
+ // because of that (this tests if all grabs are released when the mouse button is released).
+ p1 = rect->mapToScene(rect->clipRect().center()).toPoint();
+ originP1 = p1;
+ for (int i = 0; i < 3; ++i) {
+ p1 += QPoint(dragThreshold, 0);
+ QTest::mouseMove(window, p1);
+ QQuickTouchUtils::flush(window);
+ }
+ QCOMPARE(flickable->isMoving(), false);
+ QCOMPARE(originP1, rect->mapToScene(rect->clipRect().center()).toPoint());
}
QTEST_MAIN(tst_FlickableInterop)