Like QTabBar close button style

Is there a way to assign a CSS style to a QTabBar close button? Normally a QTabBar can be styled, but I cannot find it, how a button can reference CSS.

+4
source share
2 answers

There seems to be no way currently to style the close button through Qt's style sheets. Not only is this not documented, there is no style for it in src / gui / styles / qstylesheetstyle.cpp.

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

You can send it as a function request to Qt Tracker .

+2
source

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

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

All Articles