summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativelistview.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-01-27 04:03:13 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-01-27 04:03:13 (GMT)
commit05ba01a2519996a3dffaab2e498dc3d2a999dc45 (patch)
treec478929354b59407bea92e885baf0eecb4e351c8 /src/declarative/graphicsitems/qdeclarativelistview.cpp
parentf15778e60ba538b8715f6433a472ffe08a21d934 (diff)
parent5c91e32a6238fd112a7282443214c8686cda51de (diff)
downloadQt-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.cpp4
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);