diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-02-16 15:54:09 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-21 06:49:10 +0100 |
commit | b672f1974d3291cd0ad56c3c54f5398accc392b8 (patch) | |
tree | e467665ec54d650d0b5edb4ad01043f46003cecb /tests | |
parent | a37f19fa6d19e43b3a64587f224658a9fd63631a (diff) |
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 <alan.alpert@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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<model.count(); i++) { QQuickRectangle *curItem = findItem<QQuickRectangle>(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<QDeclarativePath*>(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<QQuickItem>(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; |