diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-10-24 11:40:47 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-11-14 05:10:55 +0000 |
commit | 38a016c7b1337d83d77879f45b4a2e6fec11d049 (patch) | |
tree | 13781c4ad0503fa5e664a9fbd3537c8ffe0a7232 /tests/auto | |
parent | 5885841150f36ffb44f592512513cec2fafffb0b (diff) |
QQuickEventPoint: make ungrab/cancel notifications more consistent
setGrabberPointerHandler is now implemented more similarly to
setGrabberItem. One improvement is that in
tests/manual/pointer/pinchDragFlingMPTA.qml the MPTA deactivates
when the PinchHandler takes over its touchpoint grabs.
Change-Id: I0bd4f143b5f25f1b393839f86c2a7802f1fa1886
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp index 09a3c36b6d..c6990f5656 100644 --- a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp +++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp @@ -182,12 +182,12 @@ void tst_MptaInterop::touchesThenPinch() touch.move(1, p1).move(2, p2).commit(); } - // Press a third touchpoint: PinchHandler grabs, MPTA doesn't + // Press a third touchpoint: PinchHandler grabs, MPTA loses its grabs QPoint p3 = mpta->mapToScene(QPointF(110, 200)).toPoint(); touch.stationary(1).stationary(2).press(3, p3).commit(); QQuickTouchUtils::flush(window); - QCOMPARE(tp.at(0)->property("pressed").toBool(), true); - QCOMPARE(tp.at(1)->property("pressed").toBool(), true); + QCOMPARE(tp.at(0)->property("pressed").toBool(), false); + QCOMPARE(tp.at(1)->property("pressed").toBool(), false); QCOMPARE(tp.at(2)->property("pressed").toBool(), false); QCOMPARE(mptaPressedSpy.count(), 1); QTRY_COMPARE(pointerEvent->point(2)->exclusiveGrabber(), pinch); @@ -199,9 +199,9 @@ void tst_MptaInterop::touchesThenPinch() p2 += QPoint(4, 4); p3 += QPoint(-4, 4); touch.move(1, p1).move(2, p2).move(3, p3).commit(); -// QTRY_COMPARE(tp.at(0)->property("pressed").toBool(), false); // TODO fails; MPTA doesn't know it lost its grabs -// QCOMPARE(tp.at(1)->property("pressed").toBool(), false); -// QCOMPARE(tp.at(2)->property("pressed").toBool(), false); + QTRY_COMPARE(tp.at(0)->property("pressed").toBool(), false); + QCOMPARE(tp.at(1)->property("pressed").toBool(), false); + QCOMPARE(tp.at(2)->property("pressed").toBool(), false); } qCDebug(lcPointerTests) << "scale" << pinch->scale() << "rot" << pinch->rotation(); QTRY_VERIFY(pinch->rotation() > 10); @@ -224,8 +224,8 @@ void tst_MptaInterop::touchesThenPinch() // QCOMPARE(pointerEvent->point(1)->exclusiveGrabber(), nullptr); // QCOMPARE(pointerEvent->point(2)->exclusiveGrabber(), nullptr); // QCOMPARE(pointerEvent->point(3)->exclusiveGrabber(), mpta); - QCOMPARE(tp.at(0)->property("pressed").toBool(), true); - QCOMPARE(tp.at(1)->property("pressed").toBool(), true); +// QCOMPARE(tp.at(0)->property("pressed").toBool(), true); +// QCOMPARE(tp.at(1)->property("pressed").toBool(), true); // QCOMPARE(tp.at(2)->property("pressed").toBool(), true); // QCOMPARE(tp.at(3)->property("pressed").toBool(), true); } |