From: Bea Lam Date: Wed, 24 Aug 2011 06:47:35 +0000 (+1000) Subject: mapFromModel() returned incorrect value X-Git-Tag: qt-v5.0.0-alpha1~1887 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff7bd14ec74b76c277bcd66026c42bfe209f0af6;p=profile%2Fivi%2Fqtdeclarative.git 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 Reviewed-by: Qt Sanity Bot --- diff --git a/src/declarative/items/qsgitemview.cpp b/src/declarative/items/qsgitemview.cpp index bf5d190..5543f12 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; }