I want to hide a TabButton in a TabBar.
Visible property keep the space for the button. I try to set width to 0/implicitWidth if hidden/visible but it's broke the layout.
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Window 2.12
ApplicationWindow {
visible: true
width: 640
height: 480
header: TabBar {
width: parent.width
TabButton {
text: qsTr("Home")
}
TabButton {
id: middle
visible: false
text: qsTr("Discover")
}
TabButton {
text: qsTr("Activity")
}
}
Button{
text: "click"
onClicked: {
middle.visible = !middle.visible
}
}
}
The two remaining tabs should cover all the space.