summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativegridview.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/qdeclarativegridview.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/qdeclarativegridview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 5669812..6a6ff64 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2139,13 +2139,15 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
layout();
qreal pos = position();
FxGridItem *item = visibleItem(idx);
+ qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
if (!item) {
int itemPos = rowPosAt(idx);
// save the currently visible items in case any of them end up visible again
QList<FxGridItem*> oldVisible = visibleItems;
visibleItems.clear();
visibleIndex = idx - idx % columns;
- setPosition(itemPos);
+ maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ 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));
@@ -2185,7 +2187,6 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
if (itemPos < pos)
pos = itemPos;
}
- qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
pos = qMin(pos, maxExtent);
qreal minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
pos = qMax(pos, minExtent);