diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-24 07:05:49 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-08-24 07:05:49 (GMT) |
commit | 6536f950bb4eb21f769086a9e95bb76e81a39e3c (patch) | |
tree | 2992dd868b3ae491961da535c48cb85b4507f29e /tests/auto | |
parent | 2cb91f6371a7918cfe54cc31efe61a39df89ab9e (diff) | |
parent | 0f3d7560855dd83b63ee090ee74b8770163e806c (diff) | |
download | Qt-6536f950bb4eb21f769086a9e95bb76e81a39e3c.zip Qt-6536f950bb4eb21f769086a9e95bb76e81a39e3c.tar.gz Qt-6536f950bb4eb21f769086a9e95bb76e81a39e3c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml | 5 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp | 24 |
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml b/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml new file mode 100644 index 0000000..177c405 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml @@ -0,0 +1,5 @@ +import Qt 4.7 + +PathView { + model: emptyModel +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index fdbb16d..e2ccfd2 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -84,7 +84,7 @@ private slots: void modelChanges(); void pathUpdateOnStartChanged(); void package(); - + void emptyModel(); private: QDeclarativeView *createView(); @@ -755,6 +755,28 @@ void tst_QDeclarativePathView::package() delete canvas; } +//QTBUG-13017 +void tst_QDeclarativePathView::emptyModel() +{ + QDeclarativeView *canvas = createView(); + + QStringListModel model; + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("emptyModel", &model); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/emptymodel.qml")); + qApp->processEvents(); + + QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject()); + QVERIFY(pathview != 0); + + QCOMPARE(pathview->offset(), qreal(0.0)); + + delete canvas; +} + + QDeclarativeView *tst_QDeclarativePathView::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); |