Fix QSGVisualDataModel test failure.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Thu, 15 Sep 2011 08:03:32 +0000 (18:03 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 20 Sep 2011 01:51:11 +0000 (03:51 +0200)
commite587f86d0b89c1b3a84199144d92b568d9daf220
tree490f0ef2edcb3e45d8ad542ce93631c04b1eb652
parentc3a78d52c6edad42f05b4474c495f7201a902dca
Fix QSGVisualDataModel test failure.

Because the list view isn't visible it won't trigger a relayout unless
forced by something like calling count() which means the test is
looking up a stale list of items.

VisualDataModel also wasn't clearing its cache when it changed the
root item and so could return an old item if the view didn't release
all items before querying a new one.

Task-number: QTBUG-21416
Change-Id: I71193e22965f30ea92d9861ccbeff30b64d58309
Reviewed-on: http://codereview.qt-project.org/4953
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/items/qsgvisualitemmodel.cpp
tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp