Fix handling of changes to the root index of a VisualDataModel.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Fri, 27 Jul 2012 02:33:27 +0000 (12:33 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 2 Aug 2012 00:43:36 +0000 (02:43 +0200)
commitf915ea135fe4bf74432ffa3e6041ea60d4268c67
treeeb10268a72d7e4494e7b02c215bc62d42fd82aa1
parent8dabc28e4ea6fe7946ee7770ba39410c6d95bc1d
Fix handling of changes to the root index of a VisualDataModel.

Store the root index as a QPersistentModelIndex so the index remains
valid as the model changes, and in the case the root index is
removed from the model invalidate the contents of the VisualDataModel
until a new root index or model is set.

Change-Id: I1cbc27f2068f99a02ff3d43373905dec7e35e900
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickvisualadaptormodel.cpp
src/quick/items/qquickvisualadaptormodel_p.h
src/quick/items/qquickvisualdatamodel.cpp
src/quick/items/qquickvisualdatamodel_p.h
tests/auto/quick/qquickvisualdatamodel/data/singleroleproperties-package.qml
tests/auto/quick/qquickvisualdatamodel/data/singleroleproperties.qml
tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
tests/auto/quick/shared/viewtestutil.cpp
tests/auto/quick/shared/viewtestutil.h