summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlgraphicspathview/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmlgraphicspathview/data')
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml36
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/path.qml14
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/pathview.qml66
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml4
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml57
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml57
6 files changed, 234 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml b/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml
new file mode 100644
index 0000000..8d07db2
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml
@@ -0,0 +1,36 @@
+import Qt 4.6
+
+PathView {
+ id: pathview
+ objectName: "pathview"
+ width: 240; height: 320
+ pathItemCount: testObject.pathItemCount
+
+ function checkProperties() {
+ testObject.error = false;
+ if (testObject.useModel && pathview.model != testData) {
+ console.log("model property incorrect");
+ testObject.error = true;
+ }
+ }
+
+ model: testObject.useModel ? testData : 0
+
+ delegate: Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 20; height: 20; color: name
+ Text {
+ objectName: "myText"
+ text: name
+ }
+ }
+ }
+
+ path: Path {
+ startX: 120; startY: 20;
+ PathLine { x: 120; y: 300 }
+ }
+}
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/path.qml b/tests/auto/declarative/qmlgraphicspathview/data/path.qml
new file mode 100644
index 0000000..7e82a48
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicspathview/data/path.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Path {
+ startX: 120; startY: 100
+
+ PathAttribute { name: "scale"; value: 1.0 }
+ PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
+ PathPercent { value: 0.3 }
+ PathLine { x: 120; y: 100 }
+ PathCubic {
+ x: 180; y: 0; control1X: -10; control1Y: 90
+ control2X: 210; control2Y: 90
+ }
+}
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview.qml
new file mode 100644
index 0000000..8fa8d59
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview.qml
@@ -0,0 +1,66 @@
+import Qt 4.6
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: delegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 60
+ color: "white"
+ border.color: "black"
+ Text {
+ text: index
+ }
+ Text {
+ x: 20
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 40
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ }
+ }
+ ]
+ PathView {
+ id: view
+ objectName: "view"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: delegate
+ snapPosition: 0.01
+ path: Path {
+ startY: 120
+ startX: 160
+ PathQuad {
+ y: 120
+ x: 80
+ controlY: 330
+ controlX: 100
+ }
+ PathLine {
+ y: 160
+ x: 20
+ }
+ PathCubic {
+ y: 120
+ x: 160
+ control1Y: 0
+ control1X: 100
+ control2Y: 000
+ control2X: 200
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml
new file mode 100644
index 0000000..b3b0a9a
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml
@@ -0,0 +1,4 @@
+import Qt 4.6
+
+PathView {
+}
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml
new file mode 100644
index 0000000..0d5c98b
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml
@@ -0,0 +1,57 @@
+import Qt 4.6
+
+PathView {
+ id: photoPathView; model: rssModel; delegate: photoDelegate
+ y: 100; width: 800; height: 330; pathItemCount: 10; z: 1
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ delegate: Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+ scale: wrapper.PathView.scale
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml
new file mode 100644
index 0000000..412cca2
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml
@@ -0,0 +1,57 @@
+import Qt 4.6
+
+PathView {
+ id: photoPathView; model: rssModel; delegate: photoDelegate
+ y: 100; width: 800; height: 330; pathItemCount: 4; offset: 10
+ dragMargin: 24; snapPosition: 50
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ delegate: Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0
+ }
+ }
+ }
+}