diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-07-29 06:36:46 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-07-29 06:36:46 (GMT) |
commit | eae48b410cc28b83433b7dcba379a31aae2ce2df (patch) | |
tree | a2ee1c29f135bcd95868eb5a1cf8e389ad820a4f /src/declarative/graphicsitems/qdeclarativepathview_p_p.h | |
parent | 5d5feaa86f3933a1e89b53267953b86e2b0459ed (diff) | |
download | Qt-eae48b410cc28b83433b7dcba379a31aae2ce2df.zip Qt-eae48b410cc28b83433b7dcba379a31aae2ce2df.tar.gz Qt-eae48b410cc28b83433b7dcba379a31aae2ce2df.tar.bz2 |
Add moving and flicking properties to PathView
PathView handles its own mouse interaction, but lacked properties
similar to those in Flickable to determine when it is stationary.
This made it impossible to start an animation when the view stops moving,
for example.
Task-number: QTBUG-12497
Reviewed-by: Warwick Allison
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepathview_p_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview_p_p.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h index a0d2610..9abec2e 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h @@ -78,6 +78,7 @@ public: , lastElapsed(0), mappedRange(1.0) , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true) , autoHighlight(true), highlightUp(false), layoutScheduled(false) + , moving(false), flicking(false) , dragMargin(0), deceleration(100) , moveOffset(this, &QDeclarativePathViewPrivate::setOffset) , firstIndex(-1), pathItems(-1), requestedIndex(-1) @@ -90,15 +91,7 @@ public: { } - void init() { - Q_Q(QDeclarativePathView); - offset = 0; - q->setAcceptedMouseButtons(Qt::LeftButton); - q->setFlag(QGraphicsItem::ItemIsFocusScope); - q->setFiltersChildEvents(true); - q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked())); - lastPosTime.invalidate(); - } + void init(); void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) { if ((newGeometry.size() != oldGeometry.size()) @@ -155,6 +148,8 @@ public: bool autoHighlight : 1; bool highlightUp : 1; bool layoutScheduled : 1; + bool moving : 1; + bool flicking : 1; QElapsedTimer lastPosTime; QPointF lastPos; qreal dragMargin; |