diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-18 01:47:41 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-18 01:47:41 (GMT) |
commit | 26bbfd3c1afd34cd10f4d111b05b13e2f052cd6a (patch) | |
tree | ffcd885ce36a24e4a5c40e71ad7dac02b91b1069 | |
parent | de382f5ed26e93d1b48267736af97c48518b42b5 (diff) | |
download | Qt-26bbfd3c1afd34cd10f4d111b05b13e2f052cd6a.zip Qt-26bbfd3c1afd34cd10f4d111b05b13e2f052cd6a.tar.gz Qt-26bbfd3c1afd34cd10f4d111b05b13e2f052cd6a.tar.bz2 |
Add missing test file.
-rw-r--r-- | tests/auto/declarative/repeater/data/itemlist.qml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/auto/declarative/repeater/data/itemlist.qml b/tests/auto/declarative/repeater/data/itemlist.qml new file mode 100644 index 0000000..8d28bf8 --- /dev/null +++ b/tests/auto/declarative/repeater/data/itemlist.qml @@ -0,0 +1,49 @@ +// This example demonstrates placing items in a view using +// a VisualItemModel + +import Qt 4.6 + +Rectangle { + color: "lightgray" + width: 240 + height: 320 + + function checkProperties() { + testObject.error = false; + if (testObject.useModel && view.model != itemModel) { + print("model property incorrect"); + testObject.error = true; + } + } + + VisualItemModel { + id: itemModel + objectName: "itemModel" + Rectangle { + objectName: "item1" + height: view.height; width: view.width; color: "#FFFEF0" + 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 { 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 { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } + } + } + + Column { + objectName: "container" + Repeater { + id: view + objectName: "repeater" + anchors.fill: parent + anchors.bottomMargin: 30 + model: testObject.useModel ? itemModel : 0 + } + } +} |