aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-08-24 16:47:35 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-24 10:11:29 +0200
commitff7bd14ec74b76c277bcd66026c42bfe209f0af6 (patch)
treeaa58b636d5abc83e58e08a90004e5587f8dcd672
parent537c30a772afa0715d912011192dafec9f7e5a14 (diff)
mapFromModel() returned incorrect value
It should not add visibleIndex to the returned value. (regression from 9b5f9c8056186c9cf3c40dbac66e5f90369339dc when ListView and GridView implementations were merged). GridView used to do this and so did ListView at one point but the ListView implementation was changed. Change-Id: I94c02034580506d4b431126f1b857977e401c27a Reviewed-on: http://codereview.qt.nokia.com/3450 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
-rw-r--r--src/declarative/items/qsgitemview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/items/qsgitemview.cpp b/src/declarative/items/qsgitemview.cpp
index bf5d190ebf..5543f12f6d 100644
--- a/src/declarative/items/qsgitemview.cpp
+++ b/src/declarative/items/qsgitemview.cpp
@@ -1098,7 +1098,7 @@ int QSGItemViewPrivate::mapFromModel(int modelIndex) const
for (int i = 0; i < visibleItems.count(); ++i) {
FxViewItem *item = visibleItems.at(i);
if (item->index == modelIndex)
- return i + visibleIndex;
+ return i;
if (item->index > modelIndex)
return -1;
}