summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativevisualdatamodel
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish@forwardbias.in>2011-04-27 05:53:43 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-04-27 05:53:43 (GMT)
commitf6b7ce204ee88be0fedb4cfcff382f208fa4ed33 (patch)
tree69ce401113d1e5e665d02a0560ae589048b7b73e /tests/auto/declarative/qdeclarativevisualdatamodel
parentdcf9a1f2f20248de0da9549af54bc3a4844eaf5b (diff)
downloadQt-f6b7ce204ee88be0fedb4cfcff382f208fa4ed33.zip
Qt-f6b7ce204ee88be0fedb4cfcff382f208fa4ed33.tar.gz
Qt-f6b7ce204ee88be0fedb4cfcff382f208fa4ed33.tar.bz2
Clear the root index when the model is reset.
Task-number: QTBUG-18839 Change-Id: I46608d7481d820fa74a9be60df1e018e70a761c6 Merge-request: 2598 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativevisualdatamodel')
-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;
}