diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-03-26 08:13:29 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-03-26 08:13:29 (GMT) |
commit | c4448162a00b6a069b562756d5608d821f700546 (patch) | |
tree | 9a3f9d56ced1ba229aef983721b09d0577c3e2c3 /src/declarative/graphicsitems/qdeclarativepathview_p_p.h | |
parent | d432123cec9ac927ec9162fa8b3d16684483f994 (diff) | |
download | Qt-c4448162a00b6a069b562756d5608d821f700546.zip Qt-c4448162a00b6a069b562756d5608d821f700546.tar.gz Qt-c4448162a00b6a069b562756d5608d821f700546.tar.bz2 |
Added highlight ranges/modes to PathView
Task-number: QT-319
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepathview_p_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview_p_p.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h index 1780869..90216c0 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h @@ -74,12 +74,18 @@ class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate public: QDeclarativePathViewPrivate() - : path(0), currentIndex(0), startPc(0), lastDist(0) - , lastElapsed(0), mappedRange(1.0), stealMouse(false), ownModel(false), interactive(true) - , snapPos(0), dragMargin(0), deceleration(100) + : path(0), currentIndex(0), currentItemOffset(0.0), startPc(0), lastDist(0) + , lastElapsed(0), mappedRange(1.0) + , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true) + , autoHighlight(true), highlightUp(false), dragMargin(0), deceleration(100) , moveOffset(this, &QDeclarativePathViewPrivate::setOffset) + , moveHighlight(this, &QDeclarativePathViewPrivate::setHighlightPosition) , firstIndex(-1), pathItems(-1), requestedIndex(-1) , moveReason(Other), attType(0), highlightComponent(0), highlightItem(0) + , highlightPosition(0) + , highlightRangeStart(0), highlightRangeEnd(0) + , highlightRangeMode(QDeclarativePathView::StrictlyEnforceRange) + , highlightMoveSpeed(1.0) { } @@ -98,9 +104,10 @@ public: QDeclarativePathViewAttached *attached(QDeclarativeItem *item); void clear(); void updateMappedRange(); - qreal positionOfIndex(int index) const; + qreal positionOfIndex(qreal index) const; void createHighlight(); void updateHighlight(); + void setHighlightPosition(qreal pos); bool isValid() const { return model && model->count() > 0 && model->isValid() && path; } @@ -117,6 +124,7 @@ public: QDeclarativePath *path; int currentIndex; + qreal currentItemOffset; qreal startPc; QPointF startPoint; qreal lastDist; @@ -126,9 +134,11 @@ public: bool stealMouse : 1; bool ownModel : 1; bool interactive : 1; + bool haveHighlightRange : 1; + bool autoHighlight : 1; + bool highlightUp : 1; QTime lastPosTime; QPointF lastPos; - qreal snapPos; qreal dragMargin; qreal deceleration; QDeclarativeTimeLine tl; @@ -139,11 +149,17 @@ public: QList<QDeclarativeItem *> items; QDeclarativeGuard<QDeclarativeVisualModel> model; QVariant modelVariant; - enum MovementReason { Other, Key, Mouse }; + enum MovementReason { Other, SetIndex, Mouse }; MovementReason moveReason; QDeclarativeOpenMetaObjectType *attType; QDeclarativeComponent *highlightComponent; QDeclarativeItem *highlightItem; + QDeclarativeTimeLineValueProxy<QDeclarativePathViewPrivate> moveHighlight; + qreal highlightPosition; + qreal highlightRangeStart; + qreal highlightRangeEnd; + QDeclarativePathView::HighlightRangeMode highlightRangeMode; + qreal highlightMoveSpeed; }; QT_END_NAMESPACE |