diff options
Diffstat (limited to 'tests/auto/quick/qquickanimations/data')
47 files changed, 1057 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimations/data/Double.qml b/tests/auto/quick/qquickanimations/data/Double.qml new file mode 100644 index 0000000000..99ffca1d62 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/Double.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + id: container + property bool on: false + border.color: "#ffffff" + color: "green" + width: 50 + height: 50 + NumberAnimation on x { + objectName: "animation" + running: container.on; from: 0; to: 600; loops: Animation.Infinite; duration: 2000 + } +} diff --git a/tests/auto/quick/qquickanimations/data/attached.qml b/tests/auto/quick/qquickanimations/data/attached.qml new file mode 100644 index 0000000000..9dcfcd8752 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/attached.qml @@ -0,0 +1,34 @@ +import QtQuick 2.0 + +Rectangle { + width: 180; height: 200; + + Component { + id: delegate + Rectangle { + id: wrapper + width: 180; height: 200 + color: "blue" + + states: State { + name: "otherState" + PropertyChanges { target: wrapper; color: "green" } + } + + transitions: Transition { + PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } + ScriptAction { script: console.log(wrapper.ListView.delayRemove ? "on" : "off") } + } + + Component.onCompleted: { + console.log(ListView.delayRemove ? "on" : "off"); + wrapper.state = "otherState" + } + } + } + + ListView { + model: 1 + delegate: delegate + } +} diff --git a/tests/auto/quick/qquickanimations/data/badproperty1.qml b/tests/auto/quick/qquickanimations/data/badproperty1.qml new file mode 100644 index 0000000000..9634c2c169 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/badproperty1.qml @@ -0,0 +1,21 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 240 + height: 320 + Rectangle { + id: myRect + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + states: State { + name: "state1" + PropertyChanges { target: myRect; border.color: "blue" } + } + transitions: Transition { + ColorAnimation { target: myRect; to: "red"; property: "border.colr"; duration: 1000 } + } + Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; +} diff --git a/tests/auto/quick/qquickanimations/data/badproperty2.qml b/tests/auto/quick/qquickanimations/data/badproperty2.qml new file mode 100644 index 0000000000..c121172a99 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/badproperty2.qml @@ -0,0 +1,21 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 240 + height: 320 + Rectangle { + id: myRect + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + states: State { + name: "state1" + PropertyChanges { target: myRect; border.color: "blue" } + } + transitions: Transition { + ColorAnimation { target: myRect; to: "red"; property: "border"; duration: 1000 } + } + Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; +} diff --git a/tests/auto/quick/qquickanimations/data/badtype1.qml b/tests/auto/quick/qquickanimations/data/badtype1.qml new file mode 100644 index 0000000000..43e1ec8572 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/badtype1.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Rectangle { + width: 240 + height: 320 + Rectangle { + color: "red" + width: 50; height: 50 + x: 100; y: 100 + PropertyAnimation on x { from: "blue"; to: "green"; } + } +} diff --git a/tests/auto/quick/qquickanimations/data/badtype2.qml b/tests/auto/quick/qquickanimations/data/badtype2.qml new file mode 100644 index 0000000000..5341cb3d1c --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/badtype2.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Rectangle { + width: 240 + height: 320 + Rectangle { + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { from: "blue"; to: "green"; } + } +} diff --git a/tests/auto/quick/qquickanimations/data/badtype3.qml b/tests/auto/quick/qquickanimations/data/badtype3.qml new file mode 100644 index 0000000000..182efa0840 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/badtype3.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Rectangle { + width: 240 + height: 320 + Rectangle { + color: "red" + ColorAnimation on color { from: 10; to: 15; } + width: 50; height: 50 + x: 100; y: 100 + } +} diff --git a/tests/auto/quick/qquickanimations/data/badtype4.qml b/tests/auto/quick/qquickanimations/data/badtype4.qml new file mode 100644 index 0000000000..f091e2430f --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/badtype4.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 240 + height: 320 + Rectangle { + id: myRect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + MouseArea { + anchors.fill: parent + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; + } + } + states: State { + name: "state1" + PropertyChanges { target: myRect; x: 200; color: "blue" } + } + transitions: Transition { + //comment out each in turn to make sure each only animates the relevant property + ColorAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + NumberAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + } +} diff --git a/tests/auto/quick/qquickanimations/data/disabledTransition.qml b/tests/auto/quick/qquickanimations/data/disabledTransition.qml new file mode 100644 index 0000000000..0fbafead8b --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/disabledTransition.qml @@ -0,0 +1,30 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + enabled: false + NumberAnimation { targets: theRect; properties: "x" } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/dontAutoStart.qml b/tests/auto/quick/qquickanimations/data/dontAutoStart.qml new file mode 100644 index 0000000000..c0c0c65e3f --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/dontAutoStart.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"; target: redRect; property: "y"; to: 300; loops: Animation.Infinite} + } + + } + +} diff --git a/tests/auto/quick/qquickanimations/data/dontStart.qml b/tests/auto/quick/qquickanimations/data/dontStart.qml new file mode 100644 index 0000000000..3eee0cfd35 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/dontStart.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 600 + height: 400 + + Rectangle { + id: redRect + width: 100; height: 100 + color: Qt.rgba(1,0,0) + SequentialAnimation on x { + running: false + NumberAnimation { objectName: "MyAnim"; running: true } + } + + } + +} diff --git a/tests/auto/quick/qquickanimations/data/dontStart2.qml b/tests/auto/quick/qquickanimations/data/dontStart2.qml new file mode 100644 index 0000000000..e7b4164e4e --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/dontStart2.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 600 + height: 400 + + Rectangle { + id: redRect + width: 100; height: 100 + color: Qt.rgba(1,0,0) + + transitions: Transition { + SequentialAnimation { + NumberAnimation { id: myAnim; objectName: "MyAnim"; running: true } + } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/dotproperty.qml b/tests/auto/quick/qquickanimations/data/dotproperty.qml new file mode 100644 index 0000000000..e0e46dcef5 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/dotproperty.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 240 + height: 320 + Rectangle { + id: myRect + color: "red" + width: 50; height: 50 + x: 100; y: 100 + MouseArea { + anchors.fill: parent + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; + } + } + states: State { + name: "state1" + PropertyChanges { target: myRect; border.color: "blue" } + } + transitions: Transition { + ColorAnimation { properties: "border.color"; duration: 1000 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/doubleRegistrationBug.qml b/tests/auto/quick/qquickanimations/data/doubleRegistrationBug.qml new file mode 100644 index 0000000000..9ef3da20c0 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/doubleRegistrationBug.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Rectangle { + width: 400; height: 400 + + Double { id: dub; on: parent.width < 800 } + Component.onCompleted: dub.on = false +} diff --git a/tests/auto/quick/qquickanimations/data/looping.qml b/tests/auto/quick/qquickanimations/data/looping.qml new file mode 100644 index 0000000000..a3d40ae837 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/looping.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 + +Item { + width: 200; height: 200 + + Rectangle { + x: 50; y: 50; width: 50; height: 50; color: "red" + + SequentialAnimation on rotation { + NumberAnimation { + from: 0; to: 90; duration: 100 + loops: 3 + } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/mixedtype1.qml b/tests/auto/quick/qquickanimations/data/mixedtype1.qml new file mode 100644 index 0000000000..76129dd15e --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/mixedtype1.qml @@ -0,0 +1,25 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 240 + height: 320 + Rectangle { + id: myRect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + MouseArea { + anchors.fill: parent + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; + } + } + states: State { + name: "state1" + PropertyChanges { target: myRect; x: 200; border.width: 10 } + } + transitions: Transition { + PropertyAnimation { properties: "x,border.width"; duration: 1000 } //x is real, border.width is int + } +} diff --git a/tests/auto/quick/qquickanimations/data/mixedtype2.qml b/tests/auto/quick/qquickanimations/data/mixedtype2.qml new file mode 100644 index 0000000000..1a7166e3f3 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/mixedtype2.qml @@ -0,0 +1,25 @@ +import QtQuick 2.0 + +Rectangle { + id: wrapper + width: 240 + height: 320 + Rectangle { + id: myRect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + MouseArea { + anchors.fill: parent + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; + } + } + states: State { + name: "state1" + PropertyChanges { target: myRect; x: 200; color: "blue" } + } + transitions: Transition { + PropertyAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + } +} diff --git a/tests/auto/quick/qquickanimations/data/nonTransitionBug.qml b/tests/auto/quick/qquickanimations/data/nonTransitionBug.qml new file mode 100644 index 0000000000..909c533e7b --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/nonTransitionBug.qml @@ -0,0 +1,30 @@ +import QtQuick 2.0 + +Rectangle { + id: root + width: 200 + height: 200 + + Rectangle { + id: mover + objectName: "mover" + } + + states: [ + State { + name: "free" + }, + State { + name: "left" + PropertyChanges { + restoreEntryValues: false + target: mover + x: 0 + } + } + ] + + transitions: Transition { + PropertyAnimation { properties: "x"; duration: 50 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathAnimation.qml b/tests/auto/quick/qquickanimations/data/pathAnimation.qml new file mode 100644 index 0000000000..d2006a1c6a --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathAnimation.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + + Rectangle { + id: redRect + color: "red" + width: 100; height: 100 + x: 50; y: 50 + } + + PathAnimation { + target: redRect + duration: 100; + path: Path { + startX: 50; startY: 50 + PathCubic { + x: 300; y: 300 + + control1X: 300; control1Y: 50 + control2X: 50; control2Y: 300 + } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathAnimation2.qml b/tests/auto/quick/qquickanimations/data/pathAnimation2.qml new file mode 100644 index 0000000000..2f64dac2cc --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathAnimation2.qml @@ -0,0 +1,26 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + + Rectangle { + id: redRect + color: "red" + width: 100; height: 100 + x: 50; y: 50 + } + + PathAnimation { + target: redRect + duration: 100; + endRotation: 0 + orientationEntryDuration: 10 + orientationExitDuration: 10 + orientation: PathAnimation.RightFirst + path: Path { + startX: 50; startY: 50 + PathLine { x: 300; y: 300 } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathAnimationNoStart.qml b/tests/auto/quick/qquickanimations/data/pathAnimationNoStart.qml new file mode 100644 index 0000000000..be3501fabb --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathAnimationNoStart.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + + Rectangle { + id: redRect + color: "red" + width: 100; height: 100 + x: 50; y: 50 + } + + PathAnimation { + target: redRect + duration: 100; + path: Path { + //no startX/Y defined (should automatically start from redRects pos) + PathCubic { + x: 300; y: 300 + + control1X: 300; control1Y: 50 + control2X: 50; control2Y: 300 + } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathInterpolator.qml b/tests/auto/quick/qquickanimations/data/pathInterpolator.qml new file mode 100644 index 0000000000..0104412d7c --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathInterpolator.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +PathInterpolator { + path: Path { + startX: 50; startY: 50 + PathCubic { + x: 300; y: 300 + + control1X: 300; control1Y: 50 + control2X: 50; control2Y: 300 + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathInterpolatorBack.qml b/tests/auto/quick/qquickanimations/data/pathInterpolatorBack.qml new file mode 100644 index 0000000000..41366ef798 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathInterpolatorBack.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +PathInterpolator { + path: Path { + startX: 50; startY: 50 + PathLine { x: 50; y: 100 } + PathLine { x: 100; y: 100 } + PathLine { x: 100; y: 50 } + PathLine { x: 200; y: 50 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathInterpolatorBack2.qml b/tests/auto/quick/qquickanimations/data/pathInterpolatorBack2.qml new file mode 100644 index 0000000000..eb3d4c3f86 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathInterpolatorBack2.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 + +PathInterpolator { + path: Path { + startX: 200; startY: 280 + PathCurve { x: 150; y: 280 } + PathCurve { x: 150; y: 80 } + PathCurve { x: 0; y: 80 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/pathTransition.qml b/tests/auto/quick/qquickanimations/data/pathTransition.qml new file mode 100644 index 0000000000..55ffc33f95 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pathTransition.qml @@ -0,0 +1,41 @@ +import QtQuick 2.0 + +Rectangle { + width: 800 + height: 800 + + Rectangle { + id: redRect; objectName: "redRect" + color: "red" + width: 50; height: 50 + x: 500; y: 50 + } + + states: State { + name: "moved" + PropertyChanges { + target: redRect + x: 100; y: 700 + } + } + + transitions: Transition { + to: "moved"; reversible: true + PathAnimation { + id: pathAnim + target: redRect + duration: 300 + path: Path { + PathCurve { x: 100; y: 100 } + PathCurve { x: 200; y: 350 } + PathCurve { x: 600; y: 500 } + PathCurve {} + } + } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = parent.state == "moved" ? "" : "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/pauseBindingBug.qml b/tests/auto/quick/qquickanimations/data/pauseBindingBug.qml new file mode 100644 index 0000000000..359cda166f --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pauseBindingBug.qml @@ -0,0 +1,17 @@ +import QtQuick 2.0 + +Rectangle { + id: rect + width: 200 + height: 200 + + property bool animating: false + property int value: 0 + + NumberAnimation on value { + objectName: "animation" + paused: !rect.animating + to: 100 + duration: 50 + } +} diff --git a/tests/auto/quick/qquickanimations/data/pauseBug.qml b/tests/auto/quick/qquickanimations/data/pauseBug.qml new file mode 100644 index 0000000000..fa2c4be4ba --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/pauseBug.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +SequentialAnimation { + id: animation + running: true + ScriptAction { script: animation.paused = true } +} diff --git a/tests/auto/quick/qquickanimations/data/properties.qml b/tests/auto/quick/qquickanimations/data/properties.qml new file mode 100644 index 0000000000..f0f730967c --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/properties.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { to: 200 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/properties2.qml b/tests/auto/quick/qquickanimations/data/properties2.qml new file mode 100644 index 0000000000..6b7f026e0b --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/properties2.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { targets: theRect; properties: "x"; to: 200; } + } +} diff --git a/tests/auto/quick/qquickanimations/data/properties3.qml b/tests/auto/quick/qquickanimations/data/properties3.qml new file mode 100644 index 0000000000..5eb65496d4 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/properties3.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { target: theRect; property: "x"; to: 300; } + } +} diff --git a/tests/auto/quick/qquickanimations/data/properties4.qml b/tests/auto/quick/qquickanimations/data/properties4.qml new file mode 100644 index 0000000000..dfe8ad17e7 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/properties4.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { target: theRect; property: "y"; to: 200; } + } +} diff --git a/tests/auto/quick/qquickanimations/data/properties5.qml b/tests/auto/quick/qquickanimations/data/properties5.qml new file mode 100644 index 0000000000..075fc9bc5a --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/properties5.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { targets: theRect; properties: "y"; to: 200; } + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition.qml new file mode 100644 index 0000000000..968c5f6285 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { targets: theRect; properties: "x" } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition2.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition2.qml new file mode 100644 index 0000000000..f06165604a --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition2.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { target: theRect; property: "y"; to: 200 } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition3.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition3.qml new file mode 100644 index 0000000000..7d3b3b9c6d --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition3.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { targets: theRect; properties: "y" } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition4.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition4.qml new file mode 100644 index 0000000000..1c31a79634 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition4.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { target: theRect; properties: "x" } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition5.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition5.qml new file mode 100644 index 0000000000..a2ff746900 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition5.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { targets: theRect; property: "x" } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition6.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition6.qml new file mode 100644 index 0000000000..d3db01efb0 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition6.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { targets: theItem; properties: "x" } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/propertiesTransition7.qml b/tests/auto/quick/qquickanimations/data/propertiesTransition7.qml new file mode 100644 index 0000000000..98898de8ef --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/propertiesTransition7.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + SpringAnimation { targets: theRect; properties: "x"; velocity: 10000 } + } + + MouseArea { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/quick/qquickanimations/data/reanchor.qml b/tests/auto/quick/qquickanimations/data/reanchor.qml new file mode 100644 index 0000000000..241cc81a96 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/reanchor.qml @@ -0,0 +1,46 @@ +import QtQuick 2.0 + +Rectangle { + id: container + width: 200; height: 200 + Rectangle { + id: myRect + color: "green"; + anchors.left: parent.left + anchors.right: rightGuideline.left + anchors.top: topGuideline.top + anchors.bottom: container.bottom + } + Item { id: leftGuideline; x: 10 } + Item { id: rightGuideline; x: 150 } + Item { id: topGuideline; y: 10 } + Item { id: bottomGuideline; y: 150 } + Item { id: topGuideline2; y: 50 } + Item { id: bottomGuideline2; y: 175 } + + states: [ State { + name: "reanchored" + AnchorChanges { + target: myRect; + anchors.left: leftGuideline.left + anchors.right: container.right + anchors.top: container.top + anchors.bottom: bottomGuideline.bottom + } + }, State { + name: "reanchored2" + AnchorChanges { + target: myRect; + anchors.left: undefined + anchors.right: undefined + anchors.top: topGuideline2.top + anchors.bottom: bottomGuideline2.bottom + } + }] + + transitions: Transition { + AnchorAnimation { } + } + + state: "reanchored" +} diff --git a/tests/auto/quick/qquickanimations/data/registrationBug.qml b/tests/auto/quick/qquickanimations/data/registrationBug.qml new file mode 100644 index 0000000000..633da4e17f --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/registrationBug.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 + +Rectangle { + id: rect + width: 200 + height: 200 + + property bool animating: true + property int value: 0 + + NumberAnimation { + target: rect + property: "value" + running: rect.animating + to: 100 + duration: 50 + } +} diff --git a/tests/auto/quick/qquickanimations/data/reparent.qml b/tests/auto/quick/qquickanimations/data/reparent.qml new file mode 100644 index 0000000000..39f1e7a6d2 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/reparent.qml @@ -0,0 +1,56 @@ +import QtQuick 2.0 + +Rectangle { + width: 400; + height: 240; + color: "black"; + + Rectangle { + id: gr + objectName: "target" + color: "green" + width: 50; height: 50 + } + + Rectangle { + id: np + objectName: "newParent" + x: 150 + width: 150; height: 150 + color: "yellow" + clip: true + Rectangle { + color: "red" + x: 50; y: 50; height: 50; width: 50 + } + + } + + Rectangle { + id: vp + objectName: "viaParent" + x: 100; y: 100 + width: 50; height: 50 + color: "blue" + rotation: 45 + scale: 2 + } + + states: State { + name: "state1" + ParentChange { + target: gr + parent: np + x: 50; y: 50; width: 100; + } + } + + transitions: Transition { + reversible: true + to: "state1" + ParentAnimation { + target: gr; via: vp; + NumberAnimation { properties: "x,y,rotation,scale,width" } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/rotation.qml b/tests/auto/quick/qquickanimations/data/rotation.qml new file mode 100644 index 0000000000..4dc42a1bd2 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/rotation.qml @@ -0,0 +1,48 @@ +import QtQuick 2.0 + +Rectangle { + width: 600; height: 200 + + Row { + spacing: 5 + Rectangle { + id: rr + objectName: "rr" + color: "red" + width: 100; height: 100 + } + Rectangle { + id: rr2 + objectName: "rr2" + color: "red" + width: 100; height: 100 + } + Rectangle { + id: rr3 + objectName: "rr3" + color: "red" + width: 100; height: 100 + } + Rectangle { + id: rr4 + objectName: "rr4" + color: "red" + width: 100; height: 100 + } + } + + states: State { + name: "state1" + PropertyChanges { target: rr; rotation: 370 } + PropertyChanges { target: rr2; rotation: 370 } + PropertyChanges { target: rr3; rotation: 370 } + PropertyChanges { target: rr4; rotation: 370 } + } + + transitions: Transition { + RotationAnimation { target: rr; direction: RotationAnimation.Numerical; duration: 1000 } + RotationAnimation { target: rr2; direction: RotationAnimation.Clockwise; duration: 1000 } + RotationAnimation { target: rr3; direction: RotationAnimation.Counterclockwise; duration: 1000 } + RotationAnimation { target: rr4; direction: RotationAnimation.Shortest; duration: 1000 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/runningTrueBug.qml b/tests/auto/quick/qquickanimations/data/runningTrueBug.qml new file mode 100644 index 0000000000..bec6fab368 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/runningTrueBug.qml @@ -0,0 +1,30 @@ +import QtQuick 2.0 +Rectangle { + color: "skyblue" + width: 500 + height: 200 + Rectangle { + objectName: "cloud" + color: "white" + y: 50 + width: 100 + height: 100 + + SequentialAnimation on x { + loops: Animation.Infinite + running: true + NumberAnimation { + id: firstAnimation + from: 0 + to: 500 + duration: 5000 + } + NumberAnimation { + id: secondAnimation + from: -100 + to: 0 + duration: 1000 + } + } + } +} diff --git a/tests/auto/quick/qquickanimations/data/transitionAssignmentBug.qml b/tests/auto/quick/qquickanimations/data/transitionAssignmentBug.qml new file mode 100644 index 0000000000..508693e0fc --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/transitionAssignmentBug.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + + property bool nullObject + Component.onCompleted: nullObject = transitions.length > 0 && transitions[0] === null + + property list<Transition> myTransitions: [Transition {}, Transition {}] + transitions: myTransitions +} diff --git a/tests/auto/quick/qquickanimations/data/valuesource.qml b/tests/auto/quick/qquickanimations/data/valuesource.qml new file mode 100644 index 0000000000..7a636b4003 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/valuesource.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { id: anim; objectName: "MyAnim"; to: 200 } + } +} diff --git a/tests/auto/quick/qquickanimations/data/valuesource2.qml b/tests/auto/quick/qquickanimations/data/valuesource2.qml new file mode 100644 index 0000000000..9788761ee8 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/valuesource2.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + NumberAnimation on x { id: anim; objectName: "MyAnim"; running: false; to: 200 } + } +} |