currentIndex not updated correctly if list is initially empty
authorBea Lam <bea.lam@nokia.com>
Thu, 29 Sep 2011 04:50:27 +0000 (14:50 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 3 Oct 2011 07:04:13 +0000 (09:04 +0200)
commitbd2eece4a68808c771d39cd53922ef538d0ba54d
tree50a819d9ae3fd662cb3799f19c79673fc9c40ad0
parente59fbf997ece61b36180eb21f9c2cd6ea895b88f
currentIndex not updated correctly if list is initially empty

The currentIndex shouldn't be incremented when itemCount == 0 and
also it should be default to 0 after the first item is added.

Task-number: QTBUG-21643
Change-Id: Ia9418c0cd1cd659410123394c880dfe72557fa16
Reviewed-on: http://codereview.qt-project.org/5768
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/items/qsgitemview.cpp
tests/auto/declarative/qsglistview/data/fillModelOnComponentCompleted.qml [moved from tests/auto/declarative/qsglistview/data/header1.qml with 91% similarity]
tests/auto/declarative/qsglistview/tst_qsglistview.cpp