forked from a-team-fr/qrythm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAiguille.qml
42 lines (37 loc) · 991 Bytes
/
Aiguille.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
import QtQuick 2.0
Image {
id: imageAiguille
property int maxDevitation: 30
property int duration : 1000
source: "qrc:/Images/images/aiguille.png"
transformOrigin: Item.Bottom
states:[
State{
name: "left"
PropertyChanges {
target: imageAiguille
rotation:-imageAiguille.maxDevitation
}
},
State{
name: "right"
PropertyChanges {
target: imageAiguille
rotation:imageAiguille.maxDevitation
}
}
]
// Pour le moment il vaut mieux retier l'animation en attendant une meilleure solution
transitions:Transition{
NumberAnimation {
properties: "rotation";
easing.type: Easing.InOutCubic
duration: imageAiguille.duration
}
}
function switchState ()
{
if (state == "left") state = "right";
else state = "left";
}
}