ListView doesn't show new 1st item currentItem is removed.
authorMartin Jones <martin.jones@nokia.com>
Thu, 28 Jul 2011 05:06:02 +0000 (15:06 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 28 Jul 2011 06:39:33 +0000 (08:39 +0200)
commitda0441aa30e1e10c1e0ac9a8cd305c1b6e63c111
tree47ed8dd27a44689c0bfb420950faf1e26fac8dc3
parent68ef13d7915fd86164b1819f7adeea22214a41b7
ListView doesn't show new 1st item currentItem is removed.

If the new 1st item becomes the currentItem after removal
it was positioned incorrectly because the currentItem is positioned
based on visibleIndex, which was updated after the currentItem
was updated.  Move visibleIndex update before currentItem update.

Change-Id: Iaf92a41eefe7bce093e3000d17f5496dba144bcd
Fixes: QTBUG-20575
Reviewed-on: http://codereview.qt.nokia.com/2316
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
src/declarative/items/qsggridview.cpp
src/declarative/items/qsglistview.cpp
src/qtquick1/graphicsitems/qdeclarativegridview.cpp
src/qtquick1/graphicsitems/qdeclarativelistview.cpp
tests/auto/declarative/qsglistview/tst_qsglistview.cpp
tests/auto/qtquick1/qdeclarativelistview/tst_qdeclarativelistview.cpp