diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-07-18 17:03:03 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-19 10:56:15 +0000 |
commit | 888e191ec80a9df2c1ad5eea7fab25692e3a33fa (patch) | |
tree | 0e1bb6a3a13ed99b81cec51296c439f30a6ddc38 /tests/auto/quick/pointerhandlers/flickableinterop | |
parent | ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 (diff) |
Call clearGrabbers each time we get a press event
This is important in order for passive grabbers to be in the same order
as if the points were pressed at the same time.
In our case, the problem occurred when we had a single-point DragHandler
together with a two-finger PinchHandler:
* One finger was pressed and moved
=> DragHandler called setPassiveGrab()
=> point0->passiveGrabbers: [DragHandler]
* A second finger was pressed and moved
=> PinchHandler called setPassiveGrab() for both points
=> point0->passiveGrabbers: [DragHandler,PinchHandler]
=> point1->passiveGrabbers: [PinchHandler]
So then as one keeps on dragging the *two* fingers, the DragHandler will
get the chance to do an exclusive grab first, (since its the first listed
passive grabber of point0), and the PinchHandler won't get the opportunity
to grab. This is not expected since their declaration order implies that
the PinchHandler should get a chance to grab first.
Change-Id: I4e82ed186eeb5bf1dae1679d393e5563072175d1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/flickableinterop')
-rw-r--r-- | tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp index 11a67cea82..2e48330758 100644 --- a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp +++ b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp @@ -231,7 +231,7 @@ void tst_FlickableInterop::mouseClickButton() // We can drag <= dragThreshold and the button still acts normal, Flickable doesn't grab p1 = button->mapToScene(QPointF(20, 20)).toPoint(); - QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, p1); + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, p1, qApp->styleHints()->mouseDoubleClickInterval() + 10); QTRY_VERIFY(button->property("pressed").toBool()); p1 += QPoint(dragThreshold, 0); QTest::mouseMove(window, p1); |