diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2011-02-04 11:28:14 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2011-02-04 11:28:14 (GMT) |
commit | ce0fc2ebeaf195368c31b143a40850f01ada450a (patch) | |
tree | 3c46a405766b4ec5a5676fca15df5d4e13ca2342 /src/declarative/graphicsitems/qdeclarativelistview.cpp | |
parent | 39e7c4de155a150a0e7da6e40f59aadecaea0a8a (diff) | |
parent | 74ad5ce57adedc91717ffd67e3e65b8f76d12052 (diff) | |
download | Qt-ce0fc2ebeaf195368c31b143a40850f01ada450a.zip Qt-ce0fc2ebeaf195368c31b143a40850f01ada450a.tar.gz Qt-ce0fc2ebeaf195368c31b143a40850f01ada450a.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Conflicts:
doc/src/declarative/extending.qdoc
doc/src/external-resources.qdoc
src/declarative/util/qdeclarativeanimation.cpp
src/declarative/util/qdeclarativetransition.cpp
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index b4fd571..b4b3fa7 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2603,6 +2603,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode) d->layout(); qreal pos = d->position(); FxListItem *item = d->visibleItem(index); + qreal maxExtent = d->orient == QDeclarativeListView::Vertical ? -maxYExtent() : -maxXExtent(); if (!item) { int itemPos = d->positionAt(index); // save the currently visible items in case any of them end up visible again @@ -2610,7 +2611,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode) d->visibleItems.clear(); d->visiblePos = itemPos; d->visibleIndex = index; - d->setPosition(itemPos); + d->setPosition(qMin(qreal(itemPos), maxExtent)); // now release the reference to all the old visible items. for (int i = 0; i < oldVisible.count(); ++i) d->releaseItem(oldVisible.at(i)); @@ -2640,7 +2641,6 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode) if (itemPos < pos) pos = itemPos; } - qreal maxExtent = d->orient == QDeclarativeListView::Vertical ? -maxYExtent() : -maxXExtent(); pos = qMin(pos, maxExtent); qreal minExtent = d->orient == QDeclarativeListView::Vertical ? -minYExtent() : -minXExtent(); pos = qMax(pos, minExtent); |