summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativegridview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-31 05:27:17 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-31 05:27:17 (GMT)
commite178cf86ff5007d5af31181d064b1bf824ffbc33 (patch)
tree43c85cc4ad5ef2ea69407ea7d0217000202a9b31 /src/declarative/graphicsitems/qdeclarativegridview.cpp
parent2df6a9a02a43d88d2ddb73c08c02ad29712a8fbc (diff)
downloadQt-e178cf86ff5007d5af31181d064b1bf824ffbc33.zip
Qt-e178cf86ff5007d5af31181d064b1bf824ffbc33.tar.gz
Qt-e178cf86ff5007d5af31181d064b1bf824ffbc33.tar.bz2
Fix snapping in listview.
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativegridview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 12ede34..30f04f6 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -815,7 +815,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (snapMode != QDeclarativeGridView::SnapToRow && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
data.flickTarget = maxExtent;
}
- if ((maxDistance > 0 || overShoot) && (snapMode != QDeclarativeGridView::NoSnap || highlightRange == QDeclarativeGridView::StrictlyEnforceRange)) {
+ if (maxDistance > 0 || overShoot) {
// This mode requires the grid to stop exactly on a row boundary.
qreal v = velocity;
if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
@@ -1856,6 +1856,8 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
if (d->currentItem)
d->currentItem->index = d->currentIndex;
emit currentIndexChanged();
+ } else if (d->currentIndex < 0) {
+ d->updateCurrent(0);
}
emit countChanged();
return;