From b672f1974d3291cd0ad56c3c54f5398accc392b8 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 16 Feb 2012 15:54:09 +1000 Subject: Flicking a pathview with large delegate spacing is inconsistent The deceleration is inconsistent and dragging slowly is jerky. This was largely due to the poor resolution of the path points. pointAt() now interpolates, and the dragging logic is more accurate. Also removed the rounding of item positioning so that side-by-side items don't bounce around. Task-number: QTBUG-24312 Change-Id: I956aff0b83c3c1211d5657159c3de1e4ef0b5171 Reviewed-by: Alan Alpert --- tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp b/tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp index 6b36c7e02a..8ed2ee75a6 100644 --- a/tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp @@ -718,7 +718,7 @@ void tst_QQuickPathView::pathMoved() for (int i=0; i(pathview, "wrapper", i); QPointF itemPos(path->pointAt(0.25 + i*0.25)); - QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y()))); + QCOMPARE(curItem->pos() + offset, QPointF(itemPos.x(), itemPos.y())); } pathview->setOffset(0.0); @@ -1279,8 +1279,6 @@ void tst_QQuickPathView::changePreferredHighlight() QDeclarativePath *path = qobject_cast(pathview->path()); QVERIFY(path); QPointF start = path->pointAt(0.5); - start.setX(qRound(start.x())); - start.setY(qRound(start.y())); QPointF offset;//Center of item is at point, but pos is from corner offset.setX(firstItem->width()/2); offset.setY(firstItem->height()/2); @@ -1289,8 +1287,6 @@ void tst_QQuickPathView::changePreferredHighlight() pathview->setPreferredHighlightBegin(0.8); pathview->setPreferredHighlightEnd(0.8); start = path->pointAt(0.8); - start.setX(qRound(start.x())); - start.setY(qRound(start.y())); QTRY_COMPARE(firstItem->pos() + offset, start); QCOMPARE(pathview->currentIndex(), 0); @@ -1345,7 +1341,6 @@ void tst_QQuickPathView::currentOffsetOnInsertion() QVERIFY(path); QPointF start = path->pointAt(0.5); - start = QPointF(qRound(start.x()), qRound(start.y())); QPointF offset;//Center of item is at point, but pos is from corner offset.setX(item->width()/2); offset.setY(item->height()/2); @@ -1442,7 +1437,7 @@ void tst_QQuickPathView::asynchronous() for (int i=0; i<5; i++) { QQuickItem *curItem = findItem(pathview, "wrapper", i); QPointF itemPos(path->pointAt(0.2 + i*0.2)); - QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y()))); + QCOMPARE(curItem->pos() + offset, itemPos); } delete canvas; -- cgit v1.2.3