Fix positioning issues and change content y repositioning behaviour
authorBea Lam <bea.lam@nokia.com>
Wed, 4 Jan 2012 23:59:30 +0000 (09:59 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 9 Jan 2012 06:14:31 +0000 (07:14 +0100)
commit6b6d99c1a218f1c46ae0151a01575de6092ba9a7
treed68e19b73691d4119f13358b29ca17cbd084c80b
parent95e720d1b63312e50be3df467973d098c4527b7d
Fix positioning issues and change content y repositioning behaviour

Refactor the code for re-positioning the visibleItems.first() in
QSGItemView::applyModelChanges() and fix various positioning issues.

The positioning behaviour for removing items at the start of the view
has  changed. This action will no longer cause the content y to move
down; previously the content y would always move down unless another
item was moving backwards to the first visible position. This will make
it easier to implement built-in removal transitions for the views, since
removed items cannot be animated if the content y jumps down past them.

Additionally, moving items from before a GridView should not cause the
top item in the view to move upwards and out of the view.

This also adds additional remove tests and fixes the
tst_QQuickGridView::moved() test which wasn't waiting for the polish
event after setting the content y, which caused some of the tests to
pass even though their test data was wrong.

Change-Id: Idad11a73a18f88208e73a52111ed839458e05f2d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickgridview.cpp
src/quick/items/qquickitemview.cpp
src/quick/items/qquickitemview_p_p.h
src/quick/items/qquicklistview.cpp
tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp
tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp