summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativelistview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-05-20 04:23:50 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-05-20 04:23:50 (GMT)
commit972134e16767d1ea5224fba911c894eb22b70ca4 (patch)
treef08249c9e470fc81111af4942804354cb4d31991 /src/declarative/graphicsitems/qdeclarativelistview.cpp
parent5732a44092e17829985a381400bafccc326a0d1f (diff)
downloadQt-972134e16767d1ea5224fba911c894eb22b70ca4.zip
Qt-972134e16767d1ea5224fba911c894eb22b70ca4.tar.gz
Qt-972134e16767d1ea5224fba911c894eb22b70ca4.tar.bz2
Stop highlight animators for highlightFollowsCurrentItem: false
Task-number: QTBUG-10803
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 61283df..78c56d6 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -851,13 +851,15 @@ void QDeclarativeListViewPrivate::createHighlight()
highlightPosAnimator->target = QDeclarativeProperty(highlight->item, posProp);
highlightPosAnimator->velocity = highlightMoveSpeed;
highlightPosAnimator->userDuration = highlightMoveDuration;
- highlightPosAnimator->restart();
const QLatin1String sizeProp(orient == QDeclarativeListView::Vertical ? "height" : "width");
highlightSizeAnimator = new QSmoothedAnimation(q);
highlightSizeAnimator->velocity = highlightResizeSpeed;
highlightSizeAnimator->userDuration = highlightResizeDuration;
highlightSizeAnimator->target = QDeclarativeProperty(highlight->item, sizeProp);
- highlightSizeAnimator->restart();
+ if (autoHighlight) {
+ highlightPosAnimator->restart();
+ highlightSizeAnimator->restart();
+ }
changed = true;
}
}
@@ -1682,7 +1684,14 @@ void QDeclarativeListView::setHighlightFollowsCurrentItem(bool autoHighlight)
Q_D(QDeclarativeListView);
if (d->autoHighlight != autoHighlight) {
d->autoHighlight = autoHighlight;
- d->updateHighlight();
+ if (autoHighlight) {
+ d->updateHighlight();
+ } else {
+ if (d->highlightPosAnimator)
+ d->highlightPosAnimator->stop();
+ if (d->highlightSizeAnimator)
+ d->highlightSizeAnimator->stop();
+ }
emit highlightFollowsCurrentItemChanged();
}
}