summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/data/itemlist.qml6
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp8
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/declarative/qmlgraphicslistview/data/itemlist.qml b/tests/auto/declarative/qmlgraphicslistview/data/itemlist.qml
index 36d3501..e6b5c8f 100644
--- a/tests/auto/declarative/qmlgraphicslistview/data/itemlist.qml
+++ b/tests/auto/declarative/qmlgraphicslistview/data/itemlist.qml
@@ -14,17 +14,17 @@ Rectangle {
Rectangle {
objectName: "item1"
height: view.height; width: view.width; color: "#FFFEF0"
- Text { text: "Page 1"; font.bold: true; anchors.centerIn: parent }
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
}
Rectangle {
objectName: "item2"
height: view.height; width: view.width; color: "#F0FFF7"
- Text { text: "Page 2"; font.bold: true; anchors.centerIn: parent }
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
}
Rectangle {
objectName: "item3"
height: view.height; width: view.width; color: "#F4F0FF"
- Text { text: "Page 3"; font.bold: true; anchors.centerIn: parent }
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
}
}
diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
index 25e6996..d416603 100644
--- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
+++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
@@ -906,6 +906,10 @@ void tst_QmlGraphicsListView::itemList()
QVERIFY(item);
QCOMPARE(item->x(), 0.0);
+ QmlGraphicsText *text = findItem<QmlGraphicsText>(viewport, "text1");
+ QVERIFY(text);
+ QCOMPARE(text->text(), QLatin1String("index: 0"));
+
listview->setCurrentIndex(2);
QTest::qWait(1000);
@@ -913,6 +917,10 @@ void tst_QmlGraphicsListView::itemList()
QVERIFY(item);
QCOMPARE(item->x(), 480.0);
+ text = findItem<QmlGraphicsText>(viewport, "text3");
+ QVERIFY(text);
+ QCOMPARE(text->text(), QLatin1String("index: 2"));
+
delete canvas;
}