How to Align text centre in tab button?
-
@Shankar-B said in How to Align text centre in tab button?:
tab button
What is "tab button"?
Please explain more clearly what you want to do. -
Am using tabbar component in qml. Inside tabbar am using tab button in which text is not getting centre aligned.
@Shankar-B
We would have had no idea you were asking about QML! Perhaps your question belongs better in https://forum.qt.io/category/12/qml-and-qt-quick -
@Shankar-B
We would have had no idea you were asking about QML! Perhaps your question belongs better in https://forum.qt.io/category/12/qml-and-qt-quick@JonB agreed, so moved.
you can customise it like any other Button element:
https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#customizing-buttonTabButton{ id: control text: qsTr("TabButton") contentItem: Text { text: control.text font: control.font opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter elide: Text.ElideRight } }