Files
gcs-nf/opmap/mapwidget/Triangle.qml
T
2020-04-29 16:21:03 +08:00

64 lines
1.3 KiB
QML

import QtQuick 2.6
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
Canvas {
id: canvasId
property color color: "#474747"
property string direction: "normal"
property int border: 0
property int border_color: 0
width: parent.width; height: parent.height
contextType: "2d"
onPaint: {
context.lineWidth = border
context.strokeStyle = "#00000000"
context.fillStyle = color
context.beginPath();
if(direction == "normal")
{
context.moveTo(0, 0)
context.lineTo(0, canvasId.height);
context.lineTo(canvasId.width, canvasId.height/2);
}
else
{
context.moveTo(0, canvasId.height/2)
context.lineTo(canvasId.width, 0);
context.lineTo(canvasId.width, canvasId.height);
}
context.closePath();
context.fill()
context.stroke();
}
TextInput {
id: textInput
x: 116
y: 214
width: 80
height: 20
text: qsTr("Text Input")
font.pixelSize: 12
}
DelayButton {
id: delayButton
x: 96
y: 307
text: qsTr("Delay Button")
}
CheckBox {
id: checkBox
x: 106
y: 404
text: qsTr("Check Box")
}
}