diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2013-03-12 06:04:54 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-11 02:05:46 (GMT) |
commit | 7b18c792d0575901d403e475472b9632280f54e7 (patch) | |
tree | 256505072f32ac26670827c2ee36fd1b07ccc805 /tests/auto/declarative | |
parent | ccd1b2ee01c193cd157978c1f9f08f87d0f9c94b (diff) | |
download | Qt-7b18c792d0575901d403e475472b9632280f54e7.zip Qt-7b18c792d0575901d403e475472b9632280f54e7.tar.gz Qt-7b18c792d0575901d403e475472b9632280f54e7.tar.bz2 |
Fix jump and property changes on first move when dragging a Flickable.
Fixes a regression whereby on the first mouse move the contentItem was
moved the total distance from the touch point to where the drag
distance was exceeded. For large drag thresholds this causes a
noticeable jump.
Task-number: QTBUG-30032
(cherry picked from qtquick1 3a80424aeae19e838be03aa12a5243911ec3f020)
Change-Id: I92c119d27dc2e22203484f9ada5978697d171957
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index 01ab415..549d282 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -625,6 +625,9 @@ void tst_qdeclarativeflickable::nestedStopAtBounds() axis += invert ? threshold : -threshold; moveEvent.setScenePos(position); QApplication::sendEvent(view.scene(), &moveEvent); + axis += invert ? threshold : -threshold; + moveEvent.setScenePos(position); + QApplication::sendEvent(view.scene(), &moveEvent); QVERIFY(outer->contentX() != 50 || outer->contentY() != 50); QVERIFY((inner->contentX() == 0 || inner->contentX() == 100) && (inner->contentY() == 0 || inner->contentY() == 100)); @@ -643,6 +646,9 @@ void tst_qdeclarativeflickable::nestedStopAtBounds() axis += invert ? -threshold : threshold; moveEvent.setScenePos(position); QApplication::sendEvent(view.scene(), &moveEvent); + axis += invert ? -threshold : threshold; + moveEvent.setScenePos(position); + QApplication::sendEvent(view.scene(), &moveEvent); QVERIFY(outer->contentX() == 50 && outer->contentY() == 50); QVERIFY((inner->contentX() != 0 && inner->contentX() != 100) || (inner->contentY() != 0 && inner->contentY() != 100)); diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 9b4123f..41dcc81 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -602,8 +602,8 @@ void tst_QDeclarativeMouseArea::preventStealing() QVERIFY(!mouseArea->pressed()); // Flickable content should have moved. - QCOMPARE(flickable->contentX(), 20.); - QCOMPARE(flickable->contentY(), 20.); + QCOMPARE(flickable->contentX(), 10.); + QCOMPARE(flickable->contentY(), 10.); QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50))); |