summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp14
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp18
2 files changed, 21 insertions, 11 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 1615b0f..4a6a9dc 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -735,7 +735,7 @@ void QDeclarativeGridViewPrivate::createHighlight()
QDeclarative_setParent_noEvent(item, q->contentItem());
item->setParentItem(q->contentItem());
highlight = new FxGridItem(item, q);
- if (currentItem)
+ if (currentItem && autoHighlight)
highlight->setPosition(currentItem->colPos(), currentItem->rowPos());
highlightXAnimator = new QSmoothedAnimation(q);
highlightXAnimator->target = QDeclarativeProperty(highlight->item, QLatin1String("x"));
@@ -1253,7 +1253,8 @@ void QDeclarativeGridView::setModel(const QVariant &model)
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
d->updateTrackedItem();
}
d->moveReason = QDeclarativeGridViewPrivate::Other;
@@ -1321,7 +1322,8 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate)
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
d->updateTrackedItem();
}
d->moveReason = QDeclarativeGridViewPrivate::Other;
@@ -2241,7 +2243,8 @@ void QDeclarativeGridView::componentComplete()
else
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
d->updateTrackedItem();
}
d->moveReason = QDeclarativeGridViewPrivate::Other;
@@ -2649,7 +2652,8 @@ void QDeclarativeGridView::modelReset()
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
d->updateTrackedItem();
}
d->moveReason = QDeclarativeGridViewPrivate::Other;
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 2dfee3b..d008f91 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1571,7 +1571,8 @@ void QDeclarativeListView::setModel(const QVariant &model)
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->position());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
d->updateTrackedItem();
}
}
@@ -1642,7 +1643,8 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate)
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->position());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
d->updateTrackedItem();
}
}
@@ -2632,8 +2634,10 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode)
cancelFlick();
d->setPosition(pos);
if (d->highlight) {
- d->highlight->setPosition(d->currentItem->itemPosition());
- d->highlight->setSize(d->currentItem->itemSize());
+ if (d->autoHighlight) {
+ d->highlight->setPosition(d->currentItem->itemPosition());
+ d->highlight->setSize(d->currentItem->itemSize());
+ }
d->updateHighlight();
}
}
@@ -2679,7 +2683,8 @@ void QDeclarativeListView::componentComplete()
else
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->position());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
d->updateTrackedItem();
}
d->moveReason = QDeclarativeListViewPrivate::Other;
@@ -3142,7 +3147,8 @@ void QDeclarativeListView::modelReset()
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
if (d->highlight && d->currentItem) {
- d->highlight->setPosition(d->currentItem->position());
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
d->updateTrackedItem();
}
d->moveReason = QDeclarativeListViewPrivate::Other;