From 5bcbba1312ac91f7b9f23e7a1574225e190bded4 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 2 Feb 2018 10:45:06 +0100 Subject: 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 --- .../flickableinterop/tst_flickableinterop.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/auto/quick') 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) -- cgit v1.2.3