summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-27 19:39:10 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-27 19:39:10 (GMT)
commitce4996b624678f37b13fbb7db810cccd8970a889 (patch)
treef8ba52c4160e393a78e68b381f1b9ae5bb9d34b0 /tests
parent63e89c45fcc07759c928231ac27cc25928116d45 (diff)
parentf6b7ce204ee88be0fedb4cfcff382f208fa4ed33 (diff)
downloadQt-ce4996b624678f37b13fbb7db810cccd8970a889.zip
Qt-ce4996b624678f37b13fbb7db810cccd8970a889.tar.gz
Qt-ce4996b624678f37b13fbb7db810cccd8970a889.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Clear the root index when the model is reset.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index 85d7876..7b384f8 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -190,6 +190,11 @@ void tst_qdeclarativevisualdatamodel::rootIndex()
QMetaObject::invokeMethod(obj, "setRootToParent");
QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == QModelIndex());
+ QMetaObject::invokeMethod(obj, "setRoot");
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == model.index(0,0));
+ model.clear(); // will emit modelReset()
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == QModelIndex());
+
delete obj;
}