Fix positioning of items after move
authorBea Lam <bea.lam@nokia.com>
Wed, 27 Jul 2011 08:19:01 +0000 (18:19 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 28 Jul 2011 00:21:44 +0000 (02:21 +0200)
commitae4bc85da09983c7c2ea36a283b6c123223b3287
tree98c0bdc4ff6bcd721754e8571e929b8e22903a60
parent70cb4d6d9a2193444d785519a9811dc6693a6ab6
Fix positioning of items after move

If a move happened after a contentY change but before a refill, the
position of the first visible item wasn't calculated correctly.

If the first item from visibleItems was above the content start
position and a move operation caused the items below it to move
away, this first item was not being moved to the correct position
(i.e. above the next available visible item) causing the following
visible items to be positioned incorrectly on the next refill.

ListView supported this previously but only adjusted positioning for
items before the content position, instead of for all moved items.

Fixed for both ListView and GridView and added more move-related tests.

Task-number: QTBUG-20528
Change-Id: I2ba1a2f5e49f790e694c6e1486f649f10d09c256
Reviewed-on: http://codereview.qt.nokia.com/2261
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/items/qsggridview.cpp
src/declarative/items/qsglistview.cpp
tests/auto/declarative/qsggridview/tst_qsggridview.cpp
tests/auto/declarative/qsglistview/tst_qsglistview.cpp