Through some experimentation, I discovered this:
import QtQuick
import QtQuick.Controls
ApplicationWindow {
visible: true
width: 800
height: 480
TabBar {
id: navTabs
property font myFont: Qt.font({
family: "Helvetica",
weight: Font.DemiBold,
pixelSize: 48
})
TabButton {
width: 200
font: navTabs.myFont
text: font.weight + " " + font.pixelSize
}
TabButton {
font.family: navTabs.myFont.family
font.weight: Font.Light
font.pixelSize: navTabs.myFont.pixelSize
text: font.weight + " " + font.pixelSize
}
}
}
The first TabButton references the TabBar font property as a unit, and as such, can't modify any of the fields (like weight). The second TabButton, though, only uses fields within the font property, and can set whatever it wants.
I did uncover another problem here, though - this only works if the TabButtons explicitly reference navTabs. If I try to use parent instead, I get errors suggesting that the parent is undefined.
In my example, is the TabBar not the parent of the TabButtons?
EDIT:
According to this, the answer is no. Any ideas on how to deal with this?
EDIT 2:
My original question is answered, so I'll mark this solved and start a new topic.