aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qdeclarativebehaviors/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qtquick2/qdeclarativebehaviors/data')
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/binding.qml26
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/color.qml24
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/cpptrigger.qml11
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/delayedRegistration.qml25
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/disabled.qml27
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/dontStart.qml18
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/empty.qml23
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/explicit.qml26
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty.qml23
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty2.qml23
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/groupedPropertyCrash.qml10
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/loop.qml19
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/nonSelecting2.qml26
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/parent.qml28
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/qtbug12295.qml17
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/reassignedAnimation.qml32
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/runningTrue.qml20
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/scripttrigger.qml16
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/simple.qml26
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/startOnCompleted.qml15
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/startup.qml17
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/startup2.qml16
-rw-r--r--tests/auto/qtquick2/qdeclarativebehaviors/data/valueType.qml13
23 files changed, 481 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/binding.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/binding.qml
new file mode 100644
index 0000000000..5aceefa743
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/binding.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ property real basex : 0
+ property real movedx: 200
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ x: basex
+ Behavior on x { NumberAnimation { duration: 800; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: movedx
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/color.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/color.qml
new file mode 100644
index 0000000000..a318578a9b
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/color.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100;
+ color: "green"
+ Behavior on color { ColorAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "red"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ color: "red"
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/cpptrigger.qml
new file mode 100644
index 0000000000..f033ec5aeb
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/cpptrigger.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 500; } }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/delayedRegistration.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/delayedRegistration.qml
new file mode 100644
index 0000000000..ed35a308f7
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/delayedRegistration.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: container
+
+ width: 400; height: 400;
+ property Item myItem
+
+ function doCreate() {
+ myItem = myComponent.createObject(container)
+ myItem.x = 100
+ }
+
+ Component {
+ id: myComponent
+ Rectangle {
+ width: 100
+ height: 100
+ color: "green"
+ Behavior on x { NumberAnimation { duration: 500 } }
+ }
+ }
+
+ Component.onCompleted: doCreate()
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/disabled.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/disabled.qml
new file mode 100644
index 0000000000..20860d8dde
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/disabled.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ enabled: false
+ NumberAnimation { duration: 200; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/dontStart.qml
new file mode 100644
index 0000000000..38e1ea9d9e
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/dontStart.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ Behavior on x {
+ NumberAnimation {id: myAnim; objectName: "MyAnim"; running: true }
+ }
+
+ }
+
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/empty.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/empty.qml
new file mode 100644
index 0000000000..d8f115390a
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/empty.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {}
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/explicit.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/explicit.qml
new file mode 100644
index 0000000000..20875c30e3
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/explicit.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation { target: rect; property: "x"; duration: 500; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty.qml
new file mode 100644
index 0000000000..a05ab7d54b
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on pos { PropertyAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ pos: Qt.point(200,0);
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty2.qml
new file mode 100644
index 0000000000..2f3de5131c
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/groupProperty2.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on border.width { NumberAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ border.width: 4;
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/groupedPropertyCrash.qml
new file mode 100644
index 0000000000..6835902bc5
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/groupedPropertyCrash.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 200
+ height: 200
+ Text {
+ Behavior on anchors.verticalCenterOffset { NumberAnimation { duration: 300; } }
+ text: "Hello World"
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/loop.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/loop.qml
new file mode 100644
index 0000000000..3e8d88734d
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/loop.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 200; } }
+ onXChanged: x = 100;
+ }
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/nonSelecting2.qml
new file mode 100644
index 0000000000..6357094cfe
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/nonSelecting2.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation { targets: rect; properties: "y"; duration: 200; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/parent.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/parent.qml
new file mode 100644
index 0000000000..f8c2731d86
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/parent.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on parent {
+ SequentialAnimation {
+ PauseAnimation { duration: 500 }
+ PropertyAction {}
+ }
+ }
+ }
+ Item {
+ id: newParent
+ objectName: "NewParent"
+ x: 100
+ }
+ states: State {
+ name: "reparented"
+ PropertyChanges {
+ target: rect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/qtbug12295.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/qtbug12295.qml
new file mode 100644
index 0000000000..c6bef581a4
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/qtbug12295.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 200
+ height: 200
+ color: "blue"
+
+ Rectangle {
+ id: myRect
+ objectName: "myRect"
+ width: 100
+ height: 100
+ Behavior on x {
+ NumberAnimation { duration: 500 }
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/reassignedAnimation.qml
new file mode 100644
index 0000000000..5731cb3efd
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/reassignedAnimation.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ id: myBehavior
+ objectName: "MyBehavior"
+ NumberAnimation {id: na1; duration: 200 }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+
+ NumberAnimation {id: na2; duration: 1000 }
+ Component.onCompleted: {
+ myBehavior.animation = na2;
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/runningTrue.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/runningTrue.qml
new file mode 100644
index 0000000000..4fd1136f3a
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/runningTrue.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ width:200; height:200
+
+ property real myValue: 0
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 100
+ height: 100
+ color: "green"
+ smooth: true
+ rotation: myValue
+ Behavior on rotation {
+ RotationAnimation { id: rotAnim; objectName: "rotAnim"; direction: RotationAnimation.Shortest }
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/scripttrigger.qml
new file mode 100644
index 0000000000..ff71f2b1b0
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/scripttrigger.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+
+ onColorChanged: {
+ rect.x = 200
+ }
+
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 800; } }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/simple.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/simple.qml
new file mode 100644
index 0000000000..c64a6e1928
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/simple.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation {id: na; duration: 500; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/startOnCompleted.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/startOnCompleted.qml
new file mode 100644
index 0000000000..fdc3779a5c
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/startOnCompleted.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ id: innerRect
+ width: 100; height: 100
+ color: "green"
+ Behavior on x { NumberAnimation {} }
+ }
+
+ Component.onCompleted: innerRect.x = 100
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/startup.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/startup.qml
new file mode 100644
index 0000000000..9fa74ca39e
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/startup.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ objectName: "innerRect"
+ height: 100; width: 100; color: "green"
+ property real targetX: 100
+
+ x: targetX
+ Behavior on x {
+ NumberAnimation {}
+ }
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/startup2.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/startup2.qml
new file mode 100644
index 0000000000..0654ef3644
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/startup2.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 800;
+ height: 480;
+
+ Text { id:theText; text: "hello world" }
+
+ Rectangle {
+ objectName: "innerRect"
+ color: "red"
+ x: theText.width
+ Behavior on x { NumberAnimation {} }
+ width: 100; height: 100
+ }
+}
diff --git a/tests/auto/qtquick2/qdeclarativebehaviors/data/valueType.qml b/tests/auto/qtquick2/qdeclarativebehaviors/data/valueType.qml
new file mode 100644
index 0000000000..7bc8297dc7
--- /dev/null
+++ b/tests/auto/qtquick2/qdeclarativebehaviors/data/valueType.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+Rectangle {
+ width: 400
+ height: 400
+
+ color.r: 1
+ color.g: 0
+ color.b: 1
+
+ Behavior on color.r { NumberAnimation { duration: 500; } }
+
+ function changeR() { color.r = 0 }
+}