I have a QML Item
with some Text
fields in it, which should have all the same font. Do achieve this i introduce a new property myFont
of type font
. Do initialize this property I use the Qt.font
function, which creates a font object. But I have to specify at least one property (either family
or pointSize
).
My Question is now: How can I retrieve the default font for the myFont
property?
If I create only a Text{}
item, it has already a default font attached, how can I get the same font for the myFont
property? (Meanwhile I use a hidden Text
field and create an alias to it's font
property, but I want a better solution).
Item {
property font myFont: Qt.font({pointSize: 10})
Text {
id: header
font: myFont
text: "My Header"
}
Text {
id: subject
font: myFont
text: "My Subject"
}
Text {
id: message
font: myFont
text: "Some meassage!"
}
}