开发者

How to style QTabBar close button

开发者 https://www.devze.com 2022-12-10 05:30 出处:网络
Is there a way to assign CS开发者_StackOverflow中文版S style for the QTabBar close button? Normally QTabBar can be styled, but I can\'t find its how button can be referenced from CSS.As noted in a com

Is there a way to assign CS开发者_StackOverflow中文版S style for the QTabBar close button? Normally QTabBar can be styled, but I can't find its how button can be referenced from CSS.


As noted in a comment above, since Qt 4.6 you can use following style:

 QTabBar::close-button {
     image: url(close.png);
     subcontrol-position: left;
 }


It seems like there is not currently a way to style the close button via Qt style sheets. Not only is it not documented, there doesn't seem to be a style for it in src/gui/styles/qstylesheetstyle.cpp.

You can set the button using QTabBar::setTabButton() method.

You may want to submit it as a feature request on the Qt Bug Tracker.

0

精彩评论

暂无评论...
验证码 换一张
取 消