Here's a QML file that has a Dial control and a custom shape side by side:
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3
import QtQuick.Window 2.2
import QtQuick.Shapes 1.0
Window {
id: window
visible: true
width: 400
height: 200
RowLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
spacing: 5
Dial {
id: dial1
}
Control {
id: dial2
implicitWidth: dial1.width
implicitHeight: dial1.height
antialiasing: true
Shape {
anchors.fill: parent
antialiasing: true
ShapePath {
strokeWidth: 1
strokeColor: dial2.visualFocus ? dial2.palette.highlight : dial2.palette.dark
startX: dial2.width/2
startY: 0
PathArc {
x: dial2.width/2
y: dial2.height
radiusX: dial2.width/2
radiusY: dial2.height/2
direction: PathArc.Clockwise
}
PathArc {
x: dial2.width/2
y: 0
radiusX: dial2.width/2
radiusY: dial2.height/2
direction: PathArc.Clockwise
}
}
}
}
}
}
Since antialiasing: true
is set on both the Control and the Shape, I would have expected the path to look smooth. However, it looks jagged:
How can I antialias the shape?