diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-03-30 11:28:02 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-03-30 11:28:02 (GMT) |
commit | 753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7 (patch) | |
tree | fc1467525883912cc603174cbb55174d9201e4da /src/declarative/graphicsitems/qdeclarativepathview_p_p.h | |
parent | 9181ba917aa4f842e5c3e8febebe363f4dc11c6f (diff) | |
parent | 3ac354b885dcaf7186cf8bafdfc2bdc0c6d8dbd0 (diff) | |
download | Qt-753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7.zip Qt-753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7.tar.gz Qt-753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7.tar.bz2 |
Merge remote branch 'qt/4.7' into 4.7
Conflicts:
tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepathview_p_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview_p_p.h | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h index 62f7d95..6470893 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h @@ -74,18 +74,25 @@ class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate public: QDeclarativePathViewPrivate() - : path(0), currentIndex(0), startPc(0), lastDist(0) - , lastElapsed(0), stealMouse(false), ownModel(false), activeItem(0) - , snapPos(0), dragMargin(0), moveOffset(this, &QDeclarativePathViewPrivate::setOffset) - , firstIndex(0), pathItems(-1), pathOffset(0), requestedIndex(-1) - , moveReason(Other), attType(0) + : 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) + , firstIndex(-1), pathItems(-1), requestedIndex(-1) + , moveReason(Other), attType(0), highlightComponent(0), highlightItem(0) + , moveHighlight(this, &QDeclarativePathViewPrivate::setHighlightPosition) + , highlightPosition(0) + , highlightRangeStart(0), highlightRangeEnd(0) + , highlightRangeMode(QDeclarativePathView::StrictlyEnforceRange) + , highlightMoveSpeed(1.0) { } void init() { Q_Q(QDeclarativePathView); - _offset = 0; + offset = 0; q->setAcceptedMouseButtons(Qt::LeftButton); q->setFlag(QGraphicsItem::ItemIsFocusScope); q->setFiltersChildEvents(true); @@ -96,7 +103,11 @@ public: void releaseItem(QDeclarativeItem *item); QDeclarativePathViewAttached *attached(QDeclarativeItem *item); void clear(); - + void updateMappedRange(); + qreal positionOfIndex(qreal index) const; + void createHighlight(); + void updateHighlight(); + void setHighlightPosition(qreal pos); bool isValid() const { return model && model->count() > 0 && model->isValid() && path; } @@ -113,30 +124,43 @@ public: QDeclarativePath *path; int currentIndex; + QDeclarativeGuard<QDeclarativeItem> currentItem; + qreal currentItemOffset; qreal startPc; QPointF startPoint; qreal lastDist; int lastElapsed; - qreal _offset; + qreal offset; + qreal mappedRange; bool stealMouse : 1; bool ownModel : 1; + bool interactive : 1; + bool haveHighlightRange : 1; + bool autoHighlight : 1; + bool highlightUp : 1; QTime lastPosTime; QPointF lastPos; - QDeclarativeItem *activeItem; - qreal snapPos; qreal dragMargin; + qreal deceleration; QDeclarativeTimeLine tl; QDeclarativeTimeLineValueProxy<QDeclarativePathViewPrivate> moveOffset; int firstIndex; int pathItems; - int pathOffset; int requestedIndex; 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 |