diff options
author | Bea Lam <bea.lam@nokia.com> | 2011-01-27 04:03:13 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2011-01-27 04:03:13 (GMT) |
commit | 05ba01a2519996a3dffaab2e498dc3d2a999dc45 (patch) | |
tree | c478929354b59407bea92e885baf0eecb4e351c8 /src/declarative/graphicsitems/qdeclarativelistview.cpp | |
parent | f15778e60ba538b8715f6433a472ffe08a21d934 (diff) | |
parent | 5c91e32a6238fd112a7282443214c8686cda51de (diff) | |
download | Qt-05ba01a2519996a3dffaab2e498dc3d2a999dc45.zip Qt-05ba01a2519996a3dffaab2e498dc3d2a999dc45.tar.gz Qt-05ba01a2519996a3dffaab2e498dc3d2a999dc45.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11
Conflicts:
src/declarative/graphicsitems/qdeclarativegridview.cpp
src/declarative/graphicsitems/qdeclarativelistview.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 da1e33d..cbc4311 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2572,6 +2572,7 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode) layout(); qreal pos = position(); FxListItem *item = visibleItem(idx); + qreal maxExtent = orient == QDeclarativeListView::Vertical ? -q->maxYExtent() : -q->maxXExtent(); if (!item) { int itemPos = positionAt(idx); // save the currently visible items in case any of them end up visible again @@ -2579,7 +2580,7 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode) visibleItems.clear(); visiblePos = itemPos; visibleIndex = idx; - setPosition(itemPos); + setPosition(qMin(qreal(itemPos), maxExtent)); // now release the reference to all the old visible items. for (int i = 0; i < oldVisible.count(); ++i) releaseItem(oldVisible.at(i)); @@ -2613,7 +2614,6 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode) if (itemPos < pos) pos = itemPos; } - qreal maxExtent = orient == QDeclarativeListView::Vertical ? -q->maxYExtent() : -q->maxXExtent(); pos = qMin(pos, maxExtent); qreal minExtent = orient == QDeclarativeListView::Vertical ? -q->minYExtent() : -q->minXExtent(); pos = qMax(pos, minExtent); |