From 7722786a1305d9fdd4e0e8856322352c806de25c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 27 Jun 2012 14:05:38 +1000 Subject: Changing PathView offset doesn't set currentIndex appropriately If the highlightRangeMode is StrictlyEnforceRange then the currentIndex should always be updated when the path offset changes. Task-number: QTBUG-19835 Change-Id: I2371e5abd430e770bbb8f9f9d5f4e1d17e0d8ff5 Reviewed-by: Andrew den Exter --- src/quick/items/qquickpathview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquickpathview.cpp') diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index 1c3b9aaf46..e96e98856a 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -767,6 +767,7 @@ qreal QQuickPathView::offset() const void QQuickPathView::setOffset(qreal offset) { Q_D(QQuickPathView); + d->moveReason = QQuickPathViewPrivate::Other; d->setOffset(offset); d->updateCurrent(); } @@ -1562,6 +1563,7 @@ void QQuickPathView::componentComplete() d->regenerate(); } d->updateHighlight(); + d->updateCurrent(); if (d->modelCount) emit countChanged(); @@ -1866,7 +1868,7 @@ void QQuickPathViewPrivate::createCurrentItem() void QQuickPathViewPrivate::updateCurrent() { Q_Q(QQuickPathView); - if (moveReason != Mouse) + if (moveReason == SetIndex) return; if (!modelCount || !haveHighlightRange || highlightRangeMode != QQuickPathView::StrictlyEnforceRange) return; -- cgit v1.2.3