Hi
I’m trying to understand how to make tabs in a TabView take all the available horizontal space. Setting their width is easy:
style: TabViewStyle {
id: tabStyle
frameOverlap: 1
tab: Rectangle {
color: styleData.selected ? "steelblue" :"lightsteelblue"
border.color: "steelblue"
implicitWidth: Math.max(text.width + 4, 80)
implicitHeight: 60
width: tabStyle.control.width / tabStyle.control.count
radius: 2
Text {
id: text
anchors.centerIn: parent
text: tabStyle.control.width
color: styleData.selected ? "white" : "black"
}
}
frame: Rectangle { color: "red" }
leftCorner: Rectangle { color: "cyan" }
}
but I don’t know how to change their position. tabsAlignment: Qt.AlignHCenter moves the tabs so that their left margin is in the middle of the tabBar… but they’re stacked on each other, with the first one hiding the others…
And I don’t see which properties can be used to remedy.
↧