-
Notifications
You must be signed in to change notification settings - Fork 7
/
MainWidget.qml
52 lines (46 loc) · 1.22 KB
/
MainWidget.qml
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
import QtQuick 2.0
Rectangle {
id:widget
width:parent.width
height:parent.height
color:"white"
state:"hide"
property int index: 0
states:
[
State
{
name:"active"
PropertyChanges
{
target: widget
x:parent.x
}
},
State
{
name:"hide"
PropertyChanges
{
target: widget
x:parent.x - width
}
}
]
//1)Transition元素用于为状态之间的切换提供动画支持(A. 过渡只能被状态切换激活;B. 过渡中的动画可以以串行或并行的方式执行)
//2)通过设置to和from属性,我们可以指定与特定状态绑定的动画
//3)过渡可以被设置为reversible(默认为false)。当满足条件时,自动切换到以前的状态
/*transitions:
[
Transition
{
PropertyAnimation
{
property:"x"
duration: 500
easing.type: Easing.OutBounce
easing.amplitude: 0.1
}
}
]*/
}