aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qsgvisualdatamodel/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qsgvisualdatamodel/data')
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml18
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml19
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml19
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml19
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml10
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml10
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml11
7 files changed, 106 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml b/tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml
new file mode 100644
index 0000000000..8ce59caddc
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+
+ListView {
+ width: 100
+ height: 100
+ model: VisualDataModel {
+ id: visualModel
+ objectName: "visualModel"
+ model: myModel
+ delegate: Component {
+ Rectangle {
+ height: 25
+ width: 100
+ Text { objectName: "display"; text: display }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml b/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml
new file mode 100644
index 0000000000..6d86cdea2e
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+ListView {
+ width: 100
+ height: 100
+ model: myModel
+ delegate: Item {
+ objectName: "delegate"
+ property variant test1: name
+ property variant test2: model.name
+ property variant test3: modelData
+ property variant test4: model.modelData
+ property variant test5: modelData.name
+ property variant test6: model
+ property variant test7: index
+ property variant test8: model.index
+ property variant test9: model.modelData.name
+ }
+}
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml b/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml
new file mode 100644
index 0000000000..6a92431cdf
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+ListView {
+ width: 100
+ height: 100
+ model: myModel
+ delegate: Item {
+ objectName: "delegate"
+ property variant test1: display
+ property variant test2: model.display
+ property variant test3: modelData
+ property variant test4: model.modelData
+ property variant test5: modelData.display
+ property variant test6: model
+ property variant test7: index
+ property variant test8: model.index
+ property variant test9: model.modelData.display
+ }
+}
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml
new file mode 100644
index 0000000000..9086e5ab57
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+ListView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ model: myModel
+ delegate: Component {
+ Rectangle {
+ height: 25
+ width: 100
+ color: model.modelData.color
+ Text { objectName: "name"; text: name }
+ Text { objectName: "section"; text: parent.ListView.section }
+ }
+ }
+ section.property: "name"
+ section.criteria: ViewSection.FullString
+}
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml b/tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml
new file mode 100644
index 0000000000..d5b0fcf09b
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+ListView {
+ width: 100
+ height: 100
+ model: myModel
+ delegate: Component {
+ Text { objectName: "name"; text: name }
+ }
+}
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml b/tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml
new file mode 100644
index 0000000000..c6d3413dfd
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+ListView {
+ width: 100
+ height: 100
+ model: myModel
+ delegate: Component {
+ Text { objectName: "name"; text: modelData }
+ }
+}
diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml b/tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml
new file mode 100644
index 0000000000..0bb5cd13e0
--- /dev/null
+++ b/tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.0
+
+VisualDataModel {
+ function setRoot() {
+ rootIndex = modelIndex(0);
+ }
+ function setRootToParent() {
+ rootIndex = parentModelIndex();
+ }
+ model: myModel
+}