summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlstates/data
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-11 15:45:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-11 15:45:07 (GMT)
commitb02508a00d82dd2a4bd097af22861dcdef14adea (patch)
tree96e26fcf6ce4bb3930ca0425107a43a5f829fa68 /tests/auto/declarative/qmlstates/data
parent163b383404f25f5e951959a8d5056124567ef183 (diff)
parent1c2d8e41377644df27ac0ef5cdeeecb79598661c (diff)
downloadQt-b02508a00d82dd2a4bd097af22861dcdef14adea.zip
Qt-b02508a00d82dd2a4bd097af22861dcdef14adea.tar.gz
Qt-b02508a00d82dd2a4bd097af22861dcdef14adea.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml: (3398 commits) Fixed compile of these recently renamed tests. Update QmlChanges.txt Adds qml prefix to all declarative autotests Removed "running: true" for animations used as propertyvaluesource Animations are running by default when used as property source value Fix QmlEngine offlineStoragePath test. Fix Image test on Windows. Fix FontLoader test on Windows. Test should use ceil() not floor() since ceil() is used for calculating Fix BorderImage tests on Windows. Test should use ceil() not floor() since ceil() is used for calculating Clean up Must pass app arguments onto qExec() or else test system cannot QML Object toString should use 64-bit address on 64-bit platforms Improve stability of tst_qmlecmascript::dynamicDestruction Fix tst_qmlecmascript::callQtInvokables Fixed qmldebug* tests crashing. Fix declarative/qmldom::loadDynamicProperty autotest Fix declarative/animatedimage autotest Removed the tests/auto/declarative/visual(&examples) from .pro ...
Diffstat (limited to 'tests/auto/declarative/qmlstates/data')
-rw-r--r--tests/auto/declarative/qmlstates/data/ExtendedRectangle.qml19
-rw-r--r--tests/auto/declarative/qmlstates/data/anchorChanges.qml23
-rw-r--r--tests/auto/declarative/qmlstates/data/anchorChanges2.qml21
-rw-r--r--tests/auto/declarative/qmlstates/data/anchorChanges3.qml29
-rw-r--r--tests/auto/declarative/qmlstates/data/anchorChanges4.qml22
-rw-r--r--tests/auto/declarative/qmlstates/data/anchorChanges5.qml22
-rw-r--r--tests/auto/declarative/qmlstates/data/autoStateAtStartupRestoreBug.qml18
-rw-r--r--tests/auto/declarative/qmlstates/data/basicBinding.qml12
-rw-r--r--tests/auto/declarative/qmlstates/data/basicBinding2.qml12
-rw-r--r--tests/auto/declarative/qmlstates/data/basicBinding3.qml13
-rw-r--r--tests/auto/declarative/qmlstates/data/basicBinding4.qml17
-rw-r--r--tests/auto/declarative/qmlstates/data/basicChanges.qml10
-rw-r--r--tests/auto/declarative/qmlstates/data/basicChanges2.qml15
-rw-r--r--tests/auto/declarative/qmlstates/data/basicChanges3.qml15
-rw-r--r--tests/auto/declarative/qmlstates/data/basicExtension.qml16
-rw-r--r--tests/auto/declarative/qmlstates/data/deleting.qml11
-rw-r--r--tests/auto/declarative/qmlstates/data/deletingState.qml13
-rw-r--r--tests/auto/declarative/qmlstates/data/explicit.qml15
-rw-r--r--tests/auto/declarative/qmlstates/data/fakeExtension.qml16
-rw-r--r--tests/auto/declarative/qmlstates/data/illegalTempState.qml21
-rw-r--r--tests/auto/declarative/qmlstates/data/legalTempState.qml23
-rw-r--r--tests/auto/declarative/qmlstates/data/nonExistantProp.qml11
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange.qml37
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange2.qml31
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange3.qml42
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange4.qml30
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange5.qml30
-rw-r--r--tests/auto/declarative/qmlstates/data/propertyErrors.qml10
-rw-r--r--tests/auto/declarative/qmlstates/data/restoreEntryValues.qml14
-rw-r--r--tests/auto/declarative/qmlstates/data/script.qml10
-rw-r--r--tests/auto/declarative/qmlstates/data/signalOverride.qml18
-rw-r--r--tests/auto/declarative/qmlstates/data/signalOverride2.qml9
-rw-r--r--tests/auto/declarative/qmlstates/data/signalOverrideCrash.qml15
33 files changed, 620 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlstates/data/ExtendedRectangle.qml b/tests/auto/declarative/qmlstates/data/ExtendedRectangle.qml
new file mode 100644
index 0000000..8d64663
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/ExtendedRectangle.qml
@@ -0,0 +1,19 @@
+import Qt 4.6
+Rectangle {
+ id: extendedRect
+ objectName: "extendedRect"
+ property color extendedColor: "orange"
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "green"
+ PropertyChanges {
+ target: rect
+ onDidSomething: {
+ extendedRect.color = "green"
+ extendedColor = "green"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/anchorChanges.qml b/tests/auto/declarative/qmlstates/data/anchorChanges.qml
new file mode 100644
index 0000000..7dce889
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/anchorChanges.qml
@@ -0,0 +1,23 @@
+import Qt 4.6
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ width: 50; height: 50
+ color: "green";
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ }
+ states: State {
+ name: "right"
+ AnchorChanges {
+ id: ancCh
+ target: myRect;
+ reset: "left"
+ right: container.right
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/anchorChanges2.qml b/tests/auto/declarative/qmlstates/data/anchorChanges2.qml
new file mode 100644
index 0000000..545345e
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/anchorChanges2.qml
@@ -0,0 +1,21 @@
+import Qt 4.6
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ width: 50; height: 50
+ color: "green";
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ }
+ states: State {
+ name: "right"
+ AnchorChanges {
+ target: myRect;
+ reset: "left"
+ right: parent.right
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/anchorChanges3.qml b/tests/auto/declarative/qmlstates/data/anchorChanges3.qml
new file mode 100644
index 0000000..9d5b317
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/anchorChanges3.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ left: leftGuideline.left
+ right: container.right
+ top: container.top
+ bottom: bottomGuideline.bottom
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/anchorChanges4.qml b/tests/auto/declarative/qmlstates/data/anchorChanges4.qml
new file mode 100644
index 0000000..f128989
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/anchorChanges4.qml
@@ -0,0 +1,22 @@
+import Qt 4.6
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ horizontalCenter: bottomGuideline.horizontalCenter
+ verticalCenter: leftGuideline.verticalCenter
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/anchorChanges5.qml b/tests/auto/declarative/qmlstates/data/anchorChanges5.qml
new file mode 100644
index 0000000..4e6d34b
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/anchorChanges5.qml
@@ -0,0 +1,22 @@
+import Qt 4.6
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.baseline: parent.baseline
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ horizontalCenter: bottomGuideline.horizontalCenter
+ baseline: leftGuideline.baseline
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/autoStateAtStartupRestoreBug.qml b/tests/auto/declarative/qmlstates/data/autoStateAtStartupRestoreBug.qml
new file mode 100644
index 0000000..693a5c5
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/autoStateAtStartupRestoreBug.qml
@@ -0,0 +1,18 @@
+import Qt 4.6
+
+Item {
+ id: root
+ property int input: 1
+ property int test: 9
+
+ states: [
+ State {
+ name: "portrait"
+ when: root.input == 1
+ PropertyChanges {
+ target: root
+ test: 3
+ }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicBinding.qml b/tests/auto/declarative/qmlstates/data/basicBinding.qml
new file mode 100644
index 0000000..6528113
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicBinding.qml
@@ -0,0 +1,12 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicBinding2.qml b/tests/auto/declarative/qmlstates/data/basicBinding2.qml
new file mode 100644
index 0000000..2e7b4cf
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicBinding2.qml
@@ -0,0 +1,12 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "red"
+ width: 100; height: 100
+ color: sourceColor
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicBinding3.qml b/tests/auto/declarative/qmlstates/data/basicBinding3.qml
new file mode 100644
index 0000000..a3c47d9
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicBinding3.qml
@@ -0,0 +1,13 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "red"
+ property color sourceColor2: "blue"
+ width: 100; height: 100
+ color: sourceColor
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor2 }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicBinding4.qml b/tests/auto/declarative/qmlstates/data/basicBinding4.qml
new file mode 100644
index 0000000..1f52d0e
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicBinding4.qml
@@ -0,0 +1,17 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor }
+ },
+ State {
+ name: "green"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicChanges.qml b/tests/auto/declarative/qmlstates/data/basicChanges.qml
new file mode 100644
index 0000000..88ea256
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicChanges.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicChanges2.qml b/tests/auto/declarative/qmlstates/data/basicChanges2.qml
new file mode 100644
index 0000000..4dd293f
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicChanges2.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "green"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicChanges3.qml b/tests/auto/declarative/qmlstates/data/basicChanges3.qml
new file mode 100644
index 0000000..62ab1d5
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicChanges3.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "bordered"
+ PropertyChanges { target: myRectangle; border.width: 2 }
+ }]
+}
diff --git a/tests/auto/declarative/qmlstates/data/basicExtension.qml b/tests/auto/declarative/qmlstates/data/basicExtension.qml
new file mode 100644
index 0000000..1836f8a
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/basicExtension.qml
@@ -0,0 +1,16 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "bordered"
+ extend: "blue"
+ PropertyChanges { target: myRectangle; border.width: 2 }
+ }]
+}
diff --git a/tests/auto/declarative/qmlstates/data/deleting.qml b/tests/auto/declarative/qmlstates/data/deleting.qml
new file mode 100644
index 0000000..3da0b12
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/deleting.qml
@@ -0,0 +1,11 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue"; objectName: "pc1" }
+ PropertyChanges { target: myRectangle; radius: 5; objectName: "pc2" }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/deletingState.qml b/tests/auto/declarative/qmlstates/data/deletingState.qml
new file mode 100644
index 0000000..a5e8ed3
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/deletingState.qml
@@ -0,0 +1,13 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ StateGroup {
+ id: stateGroup
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/explicit.qml b/tests/auto/declarative/qmlstates/data/explicit.qml
new file mode 100644
index 0000000..7543f84
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/explicit.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges {
+ objectName: "changes"
+ target: myRectangle; explicit: true
+ color: sourceColor
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/fakeExtension.qml b/tests/auto/declarative/qmlstates/data/fakeExtension.qml
new file mode 100644
index 0000000..c7975e1
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/fakeExtension.qml
@@ -0,0 +1,16 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "green"
+ extend: "blue"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/declarative/qmlstates/data/illegalTempState.qml b/tests/auto/declarative/qmlstates/data/illegalTempState.qml
new file mode 100644
index 0000000..2702be4
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/illegalTempState.qml
@@ -0,0 +1,21 @@
+import Qt 4.6
+
+Rectangle {
+ id: card
+ width: 100; height: 100
+
+ states: [
+ State {
+ name: "placed"
+ PropertyChanges { target: card; state: "idle" }
+ },
+ State {
+ name: "idle"
+ }
+ ]
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: card.state = "placed"
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/legalTempState.qml b/tests/auto/declarative/qmlstates/data/legalTempState.qml
new file mode 100644
index 0000000..54c97b9
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/legalTempState.qml
@@ -0,0 +1,23 @@
+import Qt 4.6
+
+Rectangle {
+ id: card
+ width: 100; height: 100
+
+ states: [
+ State {
+ name: "placed"
+ onCompleted: card.state = "idle"
+ StateChangeScript { script: console.log("entering placed") }
+ },
+ State {
+ name: "idle"
+ StateChangeScript { script: console.log("entering idle") }
+ }
+ ]
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: card.state = "placed"
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/nonExistantProp.qml b/tests/auto/declarative/qmlstates/data/nonExistantProp.qml
new file mode 100644
index 0000000..a5dd86a
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/nonExistantProp.qml
@@ -0,0 +1,11 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; colr: "blue" }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange.qml b/tests/auto/declarative/qmlstates/data/parentChange.qml
new file mode 100644
index 0000000..087da6b
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/parentChange.qml
@@ -0,0 +1,37 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400; height: 400
+ Item {
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ }
+ MouseRegion {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ x: -100; y: -50
+ Item {
+ id: newParent
+ objectName: "NewParent"
+ x: 248; y: 360
+ }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange2.qml b/tests/auto/declarative/qmlstates/data/parentChange2.qml
new file mode 100644
index 0000000..f0b00f5
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/parentChange2.qml
@@ -0,0 +1,31 @@
+import Qt 4.6
+
+Rectangle {
+ id: newParent
+ width: 400; height: 400
+ Item {
+ scale: .5
+ rotation: 15
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ }
+ MouseRegion {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange3.qml b/tests/auto/declarative/qmlstates/data/parentChange3.qml
new file mode 100644
index 0000000..2aa507c
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/parentChange3.qml
@@ -0,0 +1,42 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400; height: 400
+ Item {
+ scale: .5
+ rotation: 15
+ transformOrigin: "Center"
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ transformOrigin: "BottomLeft"
+ color: "red"
+ }
+ }
+ MouseRegion {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ x: 200; y: 200
+ rotation: 52;
+ scale: 2
+ Item {
+ id: newParent
+ x: 100; y: 100
+ }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange4.qml b/tests/auto/declarative/qmlstates/data/parentChange4.qml
new file mode 100644
index 0000000..d00274b
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/parentChange4.qml
@@ -0,0 +1,30 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseRegion {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ transform: Scale { xScale: .5; yScale: .7}
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange5.qml b/tests/auto/declarative/qmlstates/data/parentChange5.qml
new file mode 100644
index 0000000..f75e2a3
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/parentChange5.qml
@@ -0,0 +1,30 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseRegion {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ transform: Rotation { angle: 30; axis { x: 0; y: 1; z: 0 } }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/propertyErrors.qml b/tests/auto/declarative/qmlstates/data/propertyErrors.qml
new file mode 100644
index 0000000..080e833
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/propertyErrors.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; colr: "blue"; wantsFocus: true }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/restoreEntryValues.qml b/tests/auto/declarative/qmlstates/data/restoreEntryValues.qml
new file mode 100644
index 0000000..088c608
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/restoreEntryValues.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges {
+ target: myRectangle
+ restoreEntryValues: false
+ color: "blue"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/script.qml b/tests/auto/declarative/qmlstates/data/script.qml
new file mode 100644
index 0000000..3c5f33e
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/script.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ StateChangeScript { script: myRectangle.color = "blue"; }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/signalOverride.qml b/tests/auto/declarative/qmlstates/data/signalOverride.qml
new file mode 100644
index 0000000..5ba1566
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/signalOverride.qml
@@ -0,0 +1,18 @@
+import Qt 4.6
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+
+ onDidSomething: color = "blue"
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "green"
+ PropertyChanges {
+ target: rect
+ onDidSomething: color = "green"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlstates/data/signalOverride2.qml b/tests/auto/declarative/qmlstates/data/signalOverride2.qml
new file mode 100644
index 0000000..527e165
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/signalOverride2.qml
@@ -0,0 +1,9 @@
+import Qt 4.6
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+ onDidSomething: color = "blue"
+ width: 100; height: 100
+ ExtendedRectangle {}
+}
diff --git a/tests/auto/declarative/qmlstates/data/signalOverrideCrash.qml b/tests/auto/declarative/qmlstates/data/signalOverrideCrash.qml
new file mode 100644
index 0000000..702fa86
--- /dev/null
+++ b/tests/auto/declarative/qmlstates/data/signalOverrideCrash.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+
+ width: 100; height: 100
+ states: State {
+ name: "overridden"
+ PropertyChanges {
+ target: rect
+ onDidSomething: rect.state = ""
+ }
+ }
+}