aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/timelineTestApp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/timelineTestApp')
-rw-r--r--tests/manual/timelineTestApp/main.qml18
-rw-r--r--tests/manual/timelineTestApp/qml.qrc2
-rw-r--r--tests/manual/timelineTestApp/test01.qml24
-rw-r--r--tests/manual/timelineTestApp/test02.qml18
-rw-r--r--tests/manual/timelineTestApp/test04.qml222
-rw-r--r--tests/manual/timelineTestApp/test05.qml266
6 files changed, 530 insertions, 20 deletions
diff --git a/tests/manual/timelineTestApp/main.qml b/tests/manual/timelineTestApp/main.qml
index 8b43d52..64416dd 100644
--- a/tests/manual/timelineTestApp/main.qml
+++ b/tests/manual/timelineTestApp/main.qml
@@ -61,5 +61,23 @@ Window {
onClicked: loader.source = "test03.qml"
}
}
+
+ Text {
+ text: "Test 04"
+ font.pixelSize: 12
+ MouseArea {
+ anchors.fill: parent
+ onClicked: loader.source = "test04.qml"
+ }
+ }
+
+ Text {
+ text: "Test 05"
+ font.pixelSize: 12
+ MouseArea {
+ anchors.fill: parent
+ onClicked: loader.source = "test05.qml"
+ }
+ }
}
}
diff --git a/tests/manual/timelineTestApp/qml.qrc b/tests/manual/timelineTestApp/qml.qrc
index 4da9ddc..0fffb97 100644
--- a/tests/manual/timelineTestApp/qml.qrc
+++ b/tests/manual/timelineTestApp/qml.qrc
@@ -4,5 +4,7 @@
<file>test01.qml</file>
<file>test02.qml</file>
<file>test03.qml</file>
+ <file>test04.qml</file>
+ <file>test05.qml</file>
</qresource>
</RCC>
diff --git a/tests/manual/timelineTestApp/test01.qml b/tests/manual/timelineTestApp/test01.qml
index d0810aa..d395bbd 100644
--- a/tests/manual/timelineTestApp/test01.qml
+++ b/tests/manual/timelineTestApp/test01.qml
@@ -37,21 +37,10 @@ Item {
color: "blue"
MouseArea {
anchors.fill: parent
- onClicked: animation.start()
+ onClicked: animation.restart()
}
}
- NumberAnimation {
- id: animation
- target: timeline
- property: "currentFrame"
- easing.type: Easing.InOutQuad
- duration: 2000
- from: 0
- to: 100
- running: true
- }
-
Item {
width: 480
height: 480
@@ -65,6 +54,17 @@ Item {
enabled: true
+ animations: [
+ TimelineAnimation {
+ id: animation
+ duration: 2000
+ from: 0
+ to: 100
+ running: false
+ }
+
+ ]
+
KeyframeGroup {
target: rectangle
property: "x"
diff --git a/tests/manual/timelineTestApp/test02.qml b/tests/manual/timelineTestApp/test02.qml
index 861fe45..7d27a21 100644
--- a/tests/manual/timelineTestApp/test02.qml
+++ b/tests/manual/timelineTestApp/test02.qml
@@ -20,14 +20,6 @@ import QtQuick 2.0
import QtQuick.Timeline 1.0
Item {
- PropertyAnimation {
- running: true
- duration: 1000
- target: timeline
- property: "currentFrame"
- from: 0
- to: 1000
- }
Rectangle {
id: leftGauge
@@ -82,6 +74,16 @@ Item {
startFrame: 0
endFrame: 1000
+ animations: [
+
+ TimelineAnimation {
+ running: true
+ duration: 1000
+ from: 0
+ to: 1000
+ }
+ ]
+
KeyframeGroup {
target: leftGauge
property: "x"
diff --git a/tests/manual/timelineTestApp/test04.qml b/tests/manual/timelineTestApp/test04.qml
new file mode 100644
index 0000000..be09f49
--- /dev/null
+++ b/tests/manual/timelineTestApp/test04.qml
@@ -0,0 +1,222 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd
+** All rights reserved.
+** For any questions to The Qt Company, please use contact form at http://www.qt.io/contact-us
+**
+** This file is part of the Qt Enterprise Qt Quick Timeline Add-on.
+**
+** Licensees holding valid Qt Enterprise licenses may use this file in
+** accordance with the Qt Enterprise License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://www.qt.io/contact-us
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Timeline 1.0
+
+Item {
+ id: item1
+ state: "pingpong"
+
+ Timeline {
+ id: timeline
+ enabled: true
+ startFrame: 0
+ endFrame: 1000
+ animations: [
+ TimelineAnimation {
+ id: pingPongAnimation
+ to: 200
+ loops: 2
+ from: 0
+ duration: 2000
+ running: false
+ pingPong: true
+ onFinished: item1.state = "firsthalf"
+ },
+
+ TimelineAnimation {
+ id: animation01
+ to: 200
+ loops: 1
+ from: 0
+ duration: 1000
+ running: false
+ onFinished: item1.state = "secondhalf (ping pong)"
+ },
+ TimelineAnimation {
+ id: animation02
+ to: 400
+ loops: 1
+ from: 200
+ duration: 1000
+ running: false
+ pingPong: true
+ onFinished: item1.state = "last"
+ },
+ TimelineAnimation {
+ id: animation03
+ to: 0
+ loops: 1
+ from: 200
+ duration: 500
+ running: false
+ onFinished: item1.state = "pingpong"
+ }
+ ]
+
+ KeyframeGroup {
+ target: rectangle
+ property: "width"
+ Keyframe {
+ frame: 1
+ value: 50
+ }
+ }
+
+ KeyframeGroup {
+ target: rectangle
+ property: "height"
+ Keyframe {
+ frame: 1
+ value: 50
+ }
+ }
+
+ KeyframeGroup {
+ target: rectangle
+ property: "x"
+ Keyframe {
+ frame: 100
+ value: 100
+ }
+
+ Keyframe {
+ frame: 200
+ value: 200
+ }
+
+ Keyframe {
+ frame: 300
+ value: 100
+ }
+
+ Keyframe {
+ frame: 400
+ value: 0
+ }
+ }
+
+ KeyframeGroup {
+ target: rectangle
+ property: "y"
+ Keyframe {
+ frame: 100
+ value: 400
+ }
+
+ Keyframe {
+ frame: 200
+ value: 430
+ }
+
+ Keyframe {
+ frame: 300
+ value: 335
+ }
+
+ Keyframe {
+ frame: 400
+ value: 430
+ }
+ }
+
+ KeyframeGroup {
+ target: rectangle
+ property: "color"
+
+ Keyframe {
+ frame: 400
+ value: "#f61b1b"
+ }
+ }
+ }
+
+ Rectangle {
+ id: rectangle
+ x: 0
+ y: 430
+ width: 50
+ height: 50
+ color: "#f61b1b"
+ MouseArea {
+ anchors.topMargin: 109
+ anchors.fill: parent
+ onClicked: {
+ print("clicked")
+ numberAnimation.start()
+ }
+ }
+ }
+
+ Rectangle {
+ id: rectangle1
+ x: 0
+ y: 0
+ width: 85
+ height: 85
+ color: "#22f4dd"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ print("clicked")
+ numberAnimation.stop()
+ }
+ }
+ }
+
+ Text {
+ id: text1
+ x: 376
+ y: 18
+ text: item1.state
+ font.pixelSize: 12
+ }
+ states: [
+ State {
+ name: "pingpong"
+
+ PropertyChanges {
+ target: pingPongAnimation
+ running: true
+ }
+ },
+ State {
+ name: "firsthalf"
+ PropertyChanges {
+ target: animation01
+ running: true
+ }
+ },
+ State {
+ name: "secondhalf (ping pong)"
+ PropertyChanges {
+ target: animation02
+ running: true
+ }
+ },
+ State {
+ name: "last"
+ PropertyChanges {
+ target: animation03
+ running: true
+ }
+ }
+ ]
+
+}
diff --git a/tests/manual/timelineTestApp/test05.qml b/tests/manual/timelineTestApp/test05.qml
new file mode 100644
index 0000000..5464556
--- /dev/null
+++ b/tests/manual/timelineTestApp/test05.qml
@@ -0,0 +1,266 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd
+** All rights reserved.
+** For any questions to The Qt Company, please use contact form at http://www.qt.io/contact-us
+**
+** This file is part of the Qt Enterprise Qt Quick Timeline Add-on.
+**
+** Licensees holding valid Qt Enterprise licenses may use this file in
+** accordance with the Qt Enterprise License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://www.qt.io/contact-us
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Timeline 1.0
+
+Item {
+ width: 640
+ height: 480
+
+ id: root
+
+ state: "page02"
+
+ Rectangle {
+ id: rectangle
+ x: 0
+ y: 0
+ width: 64
+ height: 64
+ color: "#747474"
+
+ MouseArea {
+ anchors.fill: parent
+ id: leftArea
+ }
+ }
+
+ Rectangle {
+ id: rectangle1
+ x: 576
+ y: 0
+ width: 64
+ height: 64
+ color: "#747474"
+
+ MouseArea {
+ anchors.fill: parent
+ id: rightArea
+ }
+ }
+
+ Item {
+ id: item1
+ x: -640
+ y: 123
+ width: 1920
+ height: 480
+
+ Rectangle {
+ id: screen01
+ x: 0
+ y: 0
+ width: 640
+ height: 359
+ color: "#ffffff"
+
+ Text {
+ x: 0
+ y: 0
+ text: qsTr("Page 01")
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: 38
+ }
+ }
+
+
+ Rectangle {
+ id: screen02
+ x: 640
+ y: 0
+ width: 640
+ height: 359
+ color: "#ffffff"
+
+ Text {
+ x: 0
+ y: 0
+ text: qsTr("Page 02")
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: 38
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+
+
+ Rectangle {
+ id: screen03
+ x: 1280
+ y: 0
+ width: 640
+ height: 359
+ color: "#ffffff"
+
+ Text {
+ x: 0
+ y: 0
+ text: qsTr("Page 03")
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: 38
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ }
+
+ Timeline {
+ id: timeline
+ endFrame: 1000
+ startFrame: 0
+ enabled: true
+
+ animations: [
+ TimelineAnimation {
+ id: animationToPage01
+ from: 500
+ to: 0
+ running: false
+ onFinished: root.state = "page01"
+ },
+ TimelineAnimation {
+ id: animationToPage02Left
+ from: 0
+ to: 500
+ running: false
+ onFinished: root.state = "page02"
+ },
+ TimelineAnimation {
+ id: animationToPage02Right
+ from: 1000
+ to: 500
+ running: false
+ onFinished: root.state = "page02"
+ },
+ TimelineAnimation {
+ id: animationToPage03
+ from: 500
+ to: 1000
+ running: false
+ onFinished: root.state = "page03"
+ }
+
+ ]
+
+ KeyframeGroup {
+ target: item1
+ property: "x"
+
+ Keyframe {
+ frame: 0
+ value: 0
+ }
+
+ Keyframe {
+ frame: 500
+ value: -640
+ }
+
+ Keyframe {
+ frame: 1000
+ value: -1280
+ }
+ }
+ }
+
+ Connections {
+ target: rightArea
+ enabled: root.state == "page01"
+ onClicked: root.state = "toPage02FromLeft"
+ }
+
+ Connections {
+ target: rightArea
+ enabled: root.state == "page02"
+ onClicked: root.state = "toPage03"
+ }
+
+ Connections {
+ target: leftArea
+ enabled: root.state == "page02"
+ onClicked: root.state = "toPage01"
+ }
+
+ Connections {
+ target: leftArea
+ enabled: root.state == "page03"
+ onClicked: root.state = "toPage02FromRight"
+ }
+
+ states: [
+ State {
+ name: "page01"
+
+ PropertyChanges {
+ target: timeline
+ currentFrame: 0
+ }
+ },
+ State {
+ name: "page02"
+
+ PropertyChanges {
+ target: timeline
+ currentFrame: 500
+ }
+ },
+ State {
+ name: "page03"
+
+ PropertyChanges {
+ target: timeline
+ currentFrame: 1000
+ }
+ },
+ State {
+ name: "toPage01"
+ PropertyChanges {
+ target: animationToPage01
+ running: true
+ }
+ },
+ State {
+ name: "toPage02FromLeft"
+ PropertyChanges {
+ target: animationToPage02Left
+ running: true
+ }
+ },
+ State {
+ name: "toPage03"
+ PropertyChanges {
+ target: animationToPage03
+ running: true
+ }
+ },
+ State {
+ name: "toPage02FromRight"
+ PropertyChanges {
+ target: animationToPage02Right
+ running: true
+ }
+ }
+ ]
+
+}
+
+/*##^## Designer {
+ D{i:62;anchors_width:100;anchors_height:100}D{i:47;currentFrame__AT__NodeInstance:1}
+}
+ ##^##*/