diff options
Diffstat (limited to 'tests/auto/qtquick1/qdeclarativebehaviors/data')
21 files changed, 453 insertions, 0 deletions
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml new file mode 100644 index 0000000000..a452447f31 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml @@ -0,0 +1,26 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/color.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/color.qml new file mode 100644 index 0000000000..c4b783a0f0 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/color.qml @@ -0,0 +1,24 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml new file mode 100644 index 0000000000..88ddfaa1a7 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml @@ -0,0 +1,11 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml new file mode 100644 index 0000000000..aa384c335f --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml @@ -0,0 +1,25 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/disabled.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/disabled.qml new file mode 100644 index 0000000000..f6cfa5e33d --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/disabled.qml @@ -0,0 +1,27 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/dontStart.qml new file mode 100644 index 0000000000..e318dd2567 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/dontStart.qml @@ -0,0 +1,18 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/empty.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/empty.qml new file mode 100644 index 0000000000..6c78a84540 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/empty.qml @@ -0,0 +1,23 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/explicit.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/explicit.qml new file mode 100644 index 0000000000..3baa1ac23a --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/explicit.qml @@ -0,0 +1,26 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty.qml new file mode 100644 index 0000000000..ddb5bbd40c --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty.qml @@ -0,0 +1,23 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml new file mode 100644 index 0000000000..c0b71cdb04 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml @@ -0,0 +1,23 @@ +import QtQuick 1.0 +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + width: 100; height: 100; color: "green" + Behavior on pos.x { NumberAnimation { duration: 500; } } + } + MouseArea { + id: clicker + anchors.fill: parent + } + states: State { + name: "moved" + when: clicker.pressed + PropertyChanges { + target: rect + pos.x: 200; + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml new file mode 100644 index 0000000000..8aa590bca1 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 + +Rectangle { + width: 200 + height: 200 + Text { + Behavior on anchors.verticalCenterOffset { NumberAnimation { duration: 300; } } + text: "Hello World" + } +} diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml new file mode 100644 index 0000000000..76379c00a2 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml @@ -0,0 +1,19 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml new file mode 100644 index 0000000000..c5c78d1aa2 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml @@ -0,0 +1,26 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/parent.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/parent.qml new file mode 100644 index 0000000000..d19da298b2 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/parent.qml @@ -0,0 +1,28 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml new file mode 100644 index 0000000000..03b542164b --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml @@ -0,0 +1,17 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml new file mode 100644 index 0000000000..56ac216c5a --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml @@ -0,0 +1,32 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/runningTrue.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/runningTrue.qml new file mode 100644 index 0000000000..25cdf10acf --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/runningTrue.qml @@ -0,0 +1,20 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml new file mode 100644 index 0000000000..c05cdaa940 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml @@ -0,0 +1,16 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/simple.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/simple.qml new file mode 100644 index 0000000000..6ba0118660 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/simple.qml @@ -0,0 +1,26 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/startup.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup.qml new file mode 100644 index 0000000000..fca416c08c --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup.qml @@ -0,0 +1,17 @@ +import QtQuick 1.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/qtquick1/qdeclarativebehaviors/data/startup2.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup2.qml new file mode 100644 index 0000000000..eb627613d4 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup2.qml @@ -0,0 +1,16 @@ +import QtQuick 1.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 + } +} |