blob: 8b73c07368056f1545c9641136149137f4786d75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.2
import QtTest 1.1
Item {
id: root;
width: 200
height: 200
TestCase {
id: testCase
name: "animators-nested"
when: !animation.running
function test_endresult() {
compare(box.before, 2);
compare(box.after, 2);
}
}
Box {
id: box
anchors.centerIn: undefined
property int before: 0;
property int after: 0;
SequentialAnimation {
id: animation;
ScriptAction { script: box.before++; }
ParallelAnimation {
ScaleAnimator { target: box; from: 2.0; to: 1; duration: 100; }
OpacityAnimator { target: box; from: 0; to: 1; duration: 100; }
}
PauseAnimation { duration: 100 }
SequentialAnimation {
ParallelAnimation {
XAnimator { target: box; from: 0; to: 100; duration: 100 }
RotationAnimator { target: box; from: 0; to: 90; duration: 100 }
}
ParallelAnimation {
XAnimator { target: box; from: 100; to: 0; duration: 100 }
RotationAnimator { target: box; from: 90; to: 0; duration: 100 }
}
}
ScriptAction { script: box.after++; }
running: true
loops: 2
}
}
}
|