Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何更改突出显示中选定选项卡的线条的颜色TabBar?
TabBar
您需要自定义TabBar. 请参阅文档:
http://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-tabbar http://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-tabbutton http://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-button
正如那里所写,TabButtons 有 abackground和 a contentItem。您可以将自己的委托分配给这些属性,如文档示例中所示。在您的情况下,您可能需要定制Rectangle的 as background。
TabButton
background
contentItem
Rectangle
您可以使用 的不同属性TabButton为其所有状态定义样式。