-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPie.qml
45 lines (36 loc) · 962 Bytes
/
Pie.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
import QtQuick 2.11
import QtQuick.Shapes 1.0
Shape {
id: shape
property alias startAngle: shape.rotation
property alias sweepAngle: pathAngleArc.sweepAngle
property color color: "green"
rotation: 120
ShapePath {
strokeColor: shape.color
fillColor: shape.color
// Starting point
startX: shape.width / 2
startY: shape.height / 2
// First side of the pie
PathLine {
x: shape.width
y: shape.height / 2
}
// Arc of the pie
PathAngleArc {
id: pathAngleArc
startAngle: 0
sweepAngle: 20
radiusX: shape.width / 2
radiusY: shape.height / 2
centerX: shape.width / 2
centerY: shape.height / 2
}
// Second side of the pie, back to start
PathLine {
x: shape.width / 2
y: shape.height / 2
}
}
}