1 // This example demonstrates placing items in a view using
11 property variant itemModel: itemModel1
13 function checkProperties() {
14 testObject.error = false;
15 if (testObject.useModel && view.model != root.itemModel) {
16 console.log("model property incorrect");
17 testObject.error = true;
21 function switchModel() {
22 root.itemModel = itemModel2
27 objectName: "itemModel1"
30 height: 50; width: 100; color: "#FFFEF0"
31 Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
35 height: 50; width: 100; color: "#F0FFF7"
36 Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
40 height: 50; width: 100; color: "#F4F0FF"
41 Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
47 objectName: "itemModel2"
50 height: 50; width: 100; color: "#FFFEF0"
51 Text { objectName: "text4"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
55 height: 50; width: 100; color: "#F0FFF7"
56 Text { objectName: "text5"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
61 objectName: "container"
64 objectName: "repeater"
65 model: testObject.useModel ? root.itemModel : 0