blob: 81e1f6adc467707fbeb766a3d8acaf8834c22ba6 (
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
55
56
|
import Qt 4.6
Rectangle {
id: Page
width: 480
height: 200
color: "LightGrey"
Text {
id: HelloText
text: "Hello world!"
font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
states: [
State {
name: "down"
when: MouseRegion.pressed == true
PropertyChanges {
target: HelloText
y: 160
color: "red"
}
}
]
transitions: [
Transition {
from: "*"
to: "down"
reversible: true
ParallelAnimation {
NumberAnimation {
properties: "y"
duration: 500
easing: "easeOutBounce"
}
ColorAnimation { property: "color"; duration: 500 }
}
}
]
}
MouseRegion { id: MouseRegion; anchors.fill: HelloText }
Grid {
id: ColorPicker
x: 0
anchors.bottom: Page.bottom
width: 120; height: 50
rows: 2; columns: 3
Cell { color: "#ff0000" }
Cell { color: "#00ff00" }
Cell { color: "#0000ff" }
Cell { color: "#ffff00" }
Cell { color: "#00ffff" }
Cell { color: "#ff00ff" }
}
}
|