diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-18 04:53:14 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-18 04:53:14 (GMT) |
commit | a8fedac7834029c80ffc2baaecf6aebef2e51c47 (patch) | |
tree | 95098d23c233a4b562017cf11d977f291e6dfa4b /tests/auto/declarative/qmlgraphicsrepeater/data | |
parent | 27a4decc8f687c81dbd07315ad8d6488cfa4b4a8 (diff) | |
download | Qt-a8fedac7834029c80ffc2baaecf6aebef2e51c47.zip Qt-a8fedac7834029c80ffc2baaecf6aebef2e51c47.tar.gz Qt-a8fedac7834029c80ffc2baaecf6aebef2e51c47.tar.bz2 |
Rename repeater -> qmlgraphicsrepeater
Diffstat (limited to 'tests/auto/declarative/qmlgraphicsrepeater/data')
5 files changed, 162 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml new file mode 100644 index 0000000..2d6eae8 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + id: container + objectName: "container" + width: 240 + height: 320 + color: "white" + + function checkProperties() { + testObject.error = false; + if (repeater.delegate != comp) { + print("delegate property incorrect"); + testObject.error = true; + } + } + + Component { + id: comp + Item{} + } + + Repeater { + id: repeater + objectName: "repeater" + model: testData + delegate: comp + } +} diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml new file mode 100644 index 0000000..8d28bf8 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsrepeater/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 + } + } +} diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/objlist.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/objlist.qml new file mode 100644 index 0000000..ecc6d02 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsrepeater/data/objlist.qml @@ -0,0 +1,21 @@ +import Qt 4.6 + +Rectangle { + id: container + objectName: "container" + width: 240 + height: 320 + color: "white" + Repeater { + id: repeater + objectName: "repeater" + model: testData + property int errors: 0 + property int instantiated: 0 + Component { + Item{ + Component.onCompleted: {if(index!=modelData.idx) repeater.errors += 1; repeater.instantiated++} + } + } + } +} diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/repeater.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/repeater.qml new file mode 100644 index 0000000..7d83230 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsrepeater/data/repeater.qml @@ -0,0 +1,28 @@ +import Qt 4.6 + +Rectangle { + id: container + objectName: "container" + width: 240 + height: 320 + color: "white" + Text { + text: "Zero" + } + Repeater { + id: repeater + objectName: "repeater" + width: 240 + height: 320 + model: testData + Component { + Text { + y: index*20 + text: modelData + } + } + } + Text { + text: "Last" + } +} diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/repeater2.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/repeater2.qml new file mode 100644 index 0000000..c3c3260 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsrepeater/data/repeater2.qml @@ -0,0 +1,35 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "white" + Component { + id: myDelegate + Item { + objectName: "myDelegate" + height: 20 + Text { + y: index*20 + text: name + } + Text { + y: index*20 + x: 100 + text: number + } + } + } + Column { + id: container + objectName: "container" + Repeater { + id: repeater + objectName: "repeater" + width: 240 + height: 320 + delegate: myDelegate + model: testData + } + } +} |