Reputation: 1425
Is there a way to get one?
Why I need it. Here I have bad looking UI: Quick Controls 2 bad looking
Here is how I can adjust checkbox size: QML: Resize CheckBox
I want indicator.height
value to be equal to font's height.
Upvotes: 4
Views: 1441
Reputation: 243897
To calculate the height of the font you must use FontMetrics
:
CheckBox {
text: "CheckBox"
anchors.centerIn: parent
checked: true
indicator.width: indicator.height
indicator.height: fontMetrics.height
FontMetrics {
id: fontMetrics
}
}
Upvotes: 5