forked from KhoaTranProgrammer/QtQml_Dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGear.qml
57 lines (48 loc) · 1.58 KB
/
Gear.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
53
54
55
56
57
import QtQuick 2.0
Item {
id: id_root
property int value: 0
Rectangle {
id: id_gear
anchors.centerIn: parent
height: Math.min(id_root.width, id_root.height)
width: height
radius: width/2
color: "black"
border.color: "light green"
border.width: id_gear.height * 0.02
Repeater {
model: 7
Item {
height: id_gear.height/2
transformOrigin: Item.Bottom
rotation: index * 30 + 200
x: id_gear.width/2
Rectangle {
height: id_gear.height * 0.12 + index * id_gear.height * 0.01
width: height
color: index == value ? "light green" : "grey"
radius: width/2
antialiasing: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: id_gear.height * 0.05
Text {
anchors.centerIn: parent
color: "black"
text: index
font.pixelSize: parent.height * 0.5
font.family: "Comic Sans MS"
}
}
}
}
}
Text {
anchors.centerIn: parent
text: "Gear\nPosition"
color: "light green"
font.pixelSize: id_gear.height * 0.1
font.family: "Comic Sans MS"
}
}