diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-03-21 13:18:05 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-04 06:00:40 +0200 |
commit | 912c25633ede945fb9b64e09ecd9309e7cc2ac3c (patch) | |
tree | 35ef57607d3e586828bffaaff2f3300ebe4aabf9 /src/quick/items/qquickpathview_p_p.h | |
parent | 2e35d1c47b3a4ddadfda16e3337d4d8ef91b4ce3 (diff) |
Support snapMode in PathView
PathView missed out on snapMode, which is especially useful for
its SnapOneItem mode.
Change-Id: I0e9b080ef72d9bc1e305445cd8dfde8e21e4e3da
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/quick/items/qquickpathview_p_p.h')
-rw-r--r-- | src/quick/items/qquickpathview_p_p.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h index ac74e9a568..3285b40036 100644 --- a/src/quick/items/qquickpathview_p_p.h +++ b/src/quick/items/qquickpathview_p_p.h @@ -122,10 +122,11 @@ public: void setAdjustedOffset(qreal offset); void regenerate(); void updateItem(QQuickItem *, qreal); - void snapToCurrent(); + void snapToIndex(int index); QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const; void addVelocitySample(qreal v); qreal calcVelocity() const; + qint64 computeCurrentTime(QInputEvent *event); QQuickPath *path; int currentIndex; @@ -133,8 +134,6 @@ public: qreal currentItemOffset; qreal startPc; QPointF startPoint; - qreal lastDist; - int lastElapsed; qreal offset; qreal offsetAdj; qreal mappedRange; @@ -149,7 +148,8 @@ public: bool flicking : 1; bool requestedOnPath : 1; bool inRequest : 1; - QElapsedTimer lastPosTime; + QElapsedTimer timer; + qint64 lastPosTime; QPointF lastPos; qreal dragMargin; qreal deceleration; @@ -180,6 +180,7 @@ public: int highlightMoveDuration; int modelCount; QPODVector<qreal,10> velocityBuffer; + QQuickPathView::SnapMode snapMode; }; QT_END_NAMESPACE |