aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpathview_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-21 17:04:16 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-22 09:44:55 +0000
commit9880e74a0c01a6af6c6ab2facc2ad683d3281c90 (patch)
tree1275d9f1bb389b6a5af75c5fd793c0510b39c229 /src/quick/items/qquickpathview_p_p.h
parentddc8537ec17591e4b51293523c1369823ecd8a83 (diff)
Fix QQuickPathViewPrivate::snapToIndex()
QQuickPathView::setCurrentIndex() set moveReason to "SetIndex", but snapToIndex() overrode it to "Other". This caused updateCurrent() to change the current index during snap animation and caused binding loops in Qt Quick Controls 2. Change-Id: I6c5f34c69886cb5c234ed78535bb356fbb38b3a6 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickpathview_p_p.h')
-rw-r--r--src/quick/items/qquickpathview_p_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h
index 2a497881d4..73e4884424 100644
--- a/src/quick/items/qquickpathview_p_p.h
+++ b/src/quick/items/qquickpathview_p_p.h
@@ -114,7 +114,8 @@ public:
void setAdjustedOffset(qreal offset);
void regenerate();
void updateItem(QQuickItem *, qreal);
- void snapToIndex(int index);
+ enum MovementReason { Other, SetIndex, Mouse };
+ void snapToIndex(int index, MovementReason reason);
QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const;
void addVelocitySample(qreal v);
qreal calcVelocity() const;
@@ -163,7 +164,6 @@ public:
QList<QQuickItem *> itemCache;
QPointer<QQmlInstanceModel> model;
QVariant modelVariant;
- enum MovementReason { Other, SetIndex, Mouse };
MovementReason moveReason;
enum MovementDirection { Shortest, Negative, Positive };
MovementDirection moveDirection;