blob: 5a16af91322cd112929fa2803430119d7aeaf197 (
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
|
import Qt 4.7
Item {
id: bt_add
width: 188; height: 188
signal addClicked
Image {
id: bt_add_off;
source: "images/bt_add_off.png";
}
Image {
id: bt_add_on;
source: "images/bt_add_on.png";
opacity: 0;
Behavior on opacity { NumberAnimation { duration: 150; } }
}
MouseArea {
anchors.fill: parent
onPressed: { bt_add.state = "pressed" }
onReleased: { bt_add.state = "released"; bt_add.addClicked() }
}
states: [
State {
name: "pressed"
PropertyChanges{ target: bt_add_on; opacity: 1; }
},
State {
name: "released"
PropertyChanges{ target: bt_add_on; opacity: 0; }
}
]
}
|