diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-10 00:56:46 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-10 00:56:46 (GMT) |
commit | cca8cbafbea02b946d571f2f656c81e8c20bdbeb (patch) | |
tree | 6f71b6fbf513a772606fcf148a46dada65438da0 /tests/auto/declarative | |
parent | 50cab03d68f1da487a8a1bc89fb7971fc9340fff (diff) | |
download | Qt-cca8cbafbea02b946d571f2f656c81e8c20bdbeb.zip Qt-cca8cbafbea02b946d571f2f656c81e8c20bdbeb.tar.gz Qt-cca8cbafbea02b946d571f2f656c81e8c20bdbeb.tar.bz2 |
ListView tests.
Diffstat (limited to 'tests/auto/declarative')
3 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml index 5b1fee6..65a9d8a 100644 --- a/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml @@ -42,6 +42,7 @@ Rectangle { currentIndex: 3 width: 240 height: 320 + keyNavigationWraps: testWrap model: testModel delegate: myDelegate highlightMoveSpeed: 1000 diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml index 075e464..280173b 100644 --- a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml @@ -79,7 +79,7 @@ Rectangle { width: 240 height: 320 model: testModel - delegate: animate ? myDelegate : animatedDelegate + delegate: testAnimate ? myDelegate : animatedDelegate highlightMoveSpeed: 1000 } } diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index dc339ea..2e797d8 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -242,6 +242,7 @@ void tst_QmlGraphicsListView::items() QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testAnimate", QVariant(false)); canvas->execute(); qApp->processEvents(); @@ -289,6 +290,7 @@ void tst_QmlGraphicsListView::changed() QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testAnimate", QVariant(false)); canvas->execute(); qApp->processEvents(); @@ -322,6 +324,7 @@ void tst_QmlGraphicsListView::inserted() QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testAnimate", QVariant(false)); canvas->execute(); qApp->processEvents(); @@ -408,7 +411,7 @@ void tst_QmlGraphicsListView::removed(bool animated) QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); - ctxt->setContextProperty("animate", QVariant(animated)); + ctxt->setContextProperty("testAnimate", QVariant(animated)); canvas->execute(); qApp->processEvents(); @@ -519,6 +522,7 @@ void tst_QmlGraphicsListView::moved() QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testAnimate", QVariant(false)); canvas->execute(); qApp->processEvents(); @@ -656,6 +660,7 @@ void tst_QmlGraphicsListView::spacing() QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testAnimate", QVariant(false)); canvas->execute(); qApp->processEvents(); @@ -778,6 +783,7 @@ void tst_QmlGraphicsListView::currentIndex() QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testWrap", QVariant(false)); QString filename(SRCDIR "/data/listview-initCurrent.qml"); QFile file(filename); @@ -811,7 +817,8 @@ void tst_QmlGraphicsListView::currentIndex() QCOMPARE(listview->currentIndex(), 0); // with wrap - listview->setWrapEnabled(true); + ctxt->setContextProperty("testWrap", QVariant(true)); + QVERIFY(listview->isWrapEnabled()); listview->decrementCurrentIndex(); QCOMPARE(listview->currentIndex(), model.count()-1); |