Fix insertions above the visible index
authorBea Lam <bea.lam@nokia.com>
Wed, 12 Oct 2011 04:30:18 +0000 (14:30 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 14 Oct 2011 06:40:15 +0000 (08:40 +0200)
commita5e8e81c1d7f3fdf9421cb590de5e4613baa7fa1
tree7337eb0cdabd92278369d277e03877795e8a5255
parenta490c7caf1b7fba4fcd16573faf89591d8fb902d
Fix insertions above the visible index

The first visible item was repositioned incorrectly after an insertion
above the visible index since any insertions above the position + cache
buffer were ignored and not considered for repositioning the first item.

GridView insertion code has changed to be similar to the ListView
implementation to fix various issues when inserting above the visible
index and to remove code that crossed indexes from visibleItems with
model indexes and visible indexes.

Also adds extra insertion tests for ListView and GridView.

Change-Id: I5e129c605fdad733b61bd29850465b3b752fb63f
Reviewed-on: http://codereview.qt-project.org/6485
Reviewed-by: Bea Lam <bea.lam@nokia.com>
src/declarative/items/qsggridview.cpp
src/declarative/items/qsgitemview.cpp
src/declarative/items/qsgitemview_p_p.h
src/declarative/items/qsglistview.cpp
tests/auto/declarative/qsggridview/tst_qsggridview.cpp
tests/auto/declarative/qsglistview/tst_qsglistview.cpp