summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-04 05:41:00 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-04 05:41:00 (GMT)
commit5599ddd113fe1385e7a6aff708e12af419b8de87 (patch)
tree5eb63f0d2eaddbcce3f869cc26592c67778c9ba8
parentf26d71daa42e95fd3048704caeae32b0a0c916a4 (diff)
downloadQt-5599ddd113fe1385e7a6aff708e12af419b8de87.zip
Qt-5599ddd113fe1385e7a6aff708e12af419b8de87.tar.gz
Qt-5599ddd113fe1385e7a6aff708e12af419b8de87.tar.bz2
Don't mess with highlight size if highlightFollowsCurrentItem is false.
Task-number: QT-2630
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 18d3661..cd8d143 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -799,10 +799,13 @@ void QDeclarativeListViewPrivate::createHighlight()
if (item) {
item->setParent(q->viewport());
highlight = new FxListItem(item, q);
- if (orient == QDeclarativeListView::Vertical)
- highlight->item->setHeight(currentItem->item->height());
- else
- highlight->item->setWidth(currentItem->item->width());
+ if (currentItem && autoHighlight) {
+ if (orient == QDeclarativeListView::Vertical) {
+ highlight->item->setHeight(currentItem->item->height());
+ } else {
+ highlight->item->setWidth(currentItem->item->width());
+ }
+ }
const QLatin1String posProp(orient == QDeclarativeListView::Vertical ? "y" : "x");
highlightPosAnimator = new QDeclarativeEaseFollow(q);
highlightPosAnimator->setTarget(QDeclarativeProperty(highlight->item, posProp));