diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-11-09 02:11:59 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-11-09 02:11:59 (GMT) |
commit | 3670d62033758b12b4857c3988d94cbd96fa323b (patch) | |
tree | 341d6595b2f0196f90e85e730d6329ddb25fdc01 /tests/auto/declarative | |
parent | 7b5ecf9d033708bbc86e8b2901e3634970b6d9ab (diff) | |
parent | 766251f5eb9af692f6cfc155471c4a58f5d5be3d (diff) | |
download | Qt-3670d62033758b12b4857c3988d94cbd96fa323b.zip Qt-3670d62033758b12b4857c3988d94cbd96fa323b.tar.gz Qt-3670d62033758b12b4857c3988d94cbd96fa323b.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 4a33770..de26635 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -69,10 +69,10 @@ private slots: void qListModelInterface_moved(); void qAbstractItemModel_moved(); + void currentIndex(); void enforceRange(); void spacing(); void sections(); - void currentIndex(); private: template <class T> void items(); @@ -766,15 +766,22 @@ void tst_QmlGraphicsListView::sections() void tst_QmlGraphicsListView::currentIndex() { - QmlView *canvas = createView(SRCDIR "/data/listview-initCurrent.qml"); - TestModel model; for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), QString::number(i)); + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + QString filename(SRCDIR "/data/listview-initCurrent.qml"); + QFile file(filename); + file.open(QFile::ReadOnly); + QString qml = file.readAll(); + canvas->setQml(qml, filename); + canvas->execute(); qApp->processEvents(); @@ -785,6 +792,7 @@ void tst_QmlGraphicsListView::currentIndex() QVERIFY(viewport != 0); // current item should be third item + QCOMPARE(listview->currentIndex(), 3); QCOMPARE(listview->currentItem(), findItem<QmlGraphicsItem>(viewport, "wrapper", 3)); // no wrap |