-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathQtShape.qml
29 lines (27 loc) · 869 Bytes
/
QtShape.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
import QtQuick 2.8
import QtQuick.Shapes 1.0
Rectangle {
id: shape
property int triangleWidth: shape.width/16
property color triangleColor: "#41cd52"
color: "transparent"
Shape {
anchors.fill: parent
ShapePath {
strokeWidth: 0
strokeColor: "transparent"
fillColor: shape.triangleColor
startX: 0; startY: 0
PathLine { x: shape.triangleWidth; y: 0 }
PathLine { x: 0; y: shape.triangleWidth }
}
ShapePath {
strokeWidth: 0
strokeColor: "transparent"
fillColor: shape.triangleColor
startX: shape.width; startY: shape.height
PathLine { x: shape.width - shape.triangleWidth; y: shape.height }
PathLine { x: shape.width; y: shape.height - shape.triangleWidth }
}
}
}