import QtQuick 2.15
import QtQuick.Shapes 1.15

Shape {
    id: arch
    width: parent.width
    height: parent.height
    anchors.centerIn: parent
    property real radius: Math.min(height, width) / 2
    property real startAngle: -90
    property real stopAngle: 90
    property real strokeWidth: outerRadius / 2
    property var color: "black"
    // ANTIALIASING
    // antialias: true does not work
    // smooth: true does not work
    layer.enabled: true
    layer.samples: 8
    ShapePath {
        fillColor: "transparent"
        strokeColor: arch.color
        strokeWidth: arch.strokeWidth
        capStyle: ShapePath.FlatCap
        PathAngleArc {
            centerX: arch.width / 2; centerY: arch.height / 2
            property real radius: arch.radius - (arch.strokeWidth / 2)
            radiusX: radius; radiusY: radius
            startAngle: arch.startAngle - 90; sweepAngle: arch.stopAngle - arch.startAngle
        }
    }
}
