Fix crash when dragging items outside visible area.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Thu, 14 Jun 2012 05:11:54 +0000 (15:11 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 22 Jun 2012 10:47:31 +0000 (12:47 +0200)
commit530b773dfcd2dddeb824cb2a2c7fe1778e5c7985
tree6f129e793fb1faa095d19812eff9f2a3834a69c3
parent9e686c502be0b68f39836f29027a58466cb517b7
Fix crash when dragging items outside visible area.

If asynchronous item creation finishes while the content area of a
ListView has been dragged full outside the visible area a full refill
is triggered which can overwrite the requested index and potentially
result in a single delegate item being assigned to multiple view items
and later being doubly released.  Only create the view item object in
the createItem function to prevent this from happening.

Secondly only reset the visible items if jumping outside the buffer
range rather than just the fill range to prevent churn when the list
only contains buffered items.

Task-number: QTBUG-26232

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