projects
/
profile
/
ivi
/
qtdeclarative.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git]
/
tests
/
auto
/
declarative
/
qmlvisual
/
animation
/
colorAnimation
/
colorAnimation-visual.qml
1
import QtQuick 1.0
2
3
Rectangle {
4
id: mainrect
5
width: 200; height: 200
6
state: "first"
7
states: [
8
State {
9
name: "first"
10
PropertyChanges {
11
target: mainrect
12
color: "red"
13
}
14
},
15
State {
16
name: "second"
17
PropertyChanges {
18
target: mainrect
19
color: "blue"
20
}
21
}
22
]
23
transitions: [
24
Transition {
25
from: "first"
26
to: "second"
27
reversible: true
28
SequentialAnimation {
29
ColorAnimation {
30
duration: 2000
31
target: mainrect
32
property: "color"
33
}
34
}
35
}
36
]
37
MouseArea {
38
anchors.fill: parent
39
onClicked: { mainrect.state = 'second' }
40
}
41
}