summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativepathview.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-10 08:58:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-10 08:58:00 (GMT)
commit9a05223ea9a6ee0dbaac256607be201ea08e6fb6 (patch)
tree54e5407758a18954bdaf64146b8d3ad8532b9297 /src/declarative/graphicsitems/qdeclarativepathview.cpp
parentac27c8ad39a9646a9e509ba7a58f75eeae10bb6e (diff)
parentbfc6a32c2a203766a6debdf19a265a4f0e198403 (diff)
downloadQt-9a05223ea9a6ee0dbaac256607be201ea08e6fb6.zip
Qt-9a05223ea9a6ee0dbaac256607be201ea08e6fb6.tar.gz
Qt-9a05223ea9a6ee0dbaac256607be201ea08e6fb6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (119 commits) Add Mac OS X bundle description for qml runtime Cleanup Disallow writes to read-only value type properties Allow undefined to be assigned to QVariant properties Add a Qt.isQtObject() method Fix crash in QML library imports Remove QT_VERSION checks in QML List properties aren't read-only Small doc fix. Make sure WorkerScript thread is stopped on deletion. This also fixes Release ListModel's worker agent on deletion. Doc fixes Fix example Example code style improvements Enable other wrapping modes. TextEdit::wrap changed to TextEdit::wrapMode enumeration Remove use of obsolete "Script" element. unwarn Replace "var" with "variant" in tests Fix test after deletion of GraphicsObjectContainer. ...
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepathview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 813b525..5fcac49 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -221,7 +221,7 @@ void QDeclarativePathViewPrivate::updateHighlight()
tl.reset(moveHighlight);
moveHighlight.setValue(highlightPosition);
- const int duration = 300;
+ const int duration = highlightMoveDuration;
if (target - highlightPosition > model->count()/2) {
highlightUp = false;
@@ -691,6 +691,31 @@ void QDeclarativePathView::setHighlightRangeMode(HighlightRangeMode mode)
emit highlightRangeModeChanged();
}
+
+/*!
+ \qmlproperty int PathView::highlightMoveDuration
+ This property holds the move animation duration of the highlight delegate.
+
+ If the highlightRangeMode is StrictlyEnforceRange then this property
+ determines the speed that the items move along the path.
+
+ The default value for the duration is 300ms.
+*/
+int QDeclarativePathView::highlightMoveDuration() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightMoveDuration;
+}
+
+void QDeclarativePathView::setHighlightMoveDuration(int duration)
+{
+ Q_D(QDeclarativePathView);
+ if (d->highlightMoveDuration == duration)
+ return;
+ d->highlightMoveDuration = duration;
+ emit highlightMoveDurationChanged();
+}
+
/*!
\qmlproperty real PathView::dragMargin
This property holds the maximum distance from the path that initiate mouse dragging.
@@ -1316,7 +1341,7 @@ void QDeclarativePathViewPrivate::snapToCurrent()
tl.reset(moveOffset);
moveOffset.setValue(offset);
- const int duration = 300;
+ const int duration = highlightMoveDuration;
if (targetOffset - offset > model->count()/2) {
qreal distance = model->count() - targetOffset + offset;