diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-06 09:28:55 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-06 09:28:55 (GMT) |
commit | a6a8bee86f7e13d49d9115eb33aaee999bd15ad5 (patch) | |
tree | 6965ebdba00a655ee879bc969986cd24753c6823 /tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp | |
parent | 97e045f48a331ff97b87bd207fb811277a4fa695 (diff) | |
parent | 05b9137fe1974aa123ce6d9c16b733e1f77d8269 (diff) | |
download | Qt-a6a8bee86f7e13d49d9115eb33aaee999bd15ad5.zip Qt-a6a8bee86f7e13d49d9115eb33aaee999bd15ad5.tar.gz Qt-a6a8bee86f7e13d49d9115eb33aaee999bd15ad5.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:
PathView crashed when the path is provided with undefined values.
PathView: update modelCount before attempting to regenerate delegates.
Diffstat (limited to 'tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 9193707..bd8baab 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -87,6 +87,8 @@ private slots: void emptyModel(); void closed(); void pathUpdate(); + void visualDataModel(); + void undefinedPath(); private: QDeclarativeView *createView(); @@ -839,6 +841,32 @@ void tst_QDeclarativePathView::pathUpdate() delete canvas; } +void tst_QDeclarativePathView::visualDataModel() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/vdm.qml")); + + QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create()); + QVERIFY(obj != 0); + + QCOMPARE(obj->count(), 3); + + delete obj; +} + +void tst_QDeclarativePathView::undefinedPath() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/undefinedpath.qml")); + + QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create()); + QVERIFY(obj != 0); + + QCOMPARE(obj->count(), 3); + + delete obj; +} + QDeclarativeView *tst_QDeclarativePathView::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); |