October 28, 2011

wamo wamo
Lab Rat
21 posts

QTabWidget: different close image for selected Tab

 

Is it possible to have a different close image for active or inactive tabs?

I want to have an image for active and hovered tabs and no image for inactive tabs.

Thank you

4 replies

October 28, 2011

Andre Andre
Area 51 Engineer
6076 posts

I think that that is up to the style to render. However, I think you might be able to do what you want using a style sheet too. Check the Qt style sheet reference, and take a look at the last part of the example for customizing a tab bar.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

October 28, 2011

wamo wamo
Lab Rat
21 posts
Andre wrote:
I think that that is up to the style to render. However, I think you might be able to do what you want using a style sheet too. Check the Qt style sheet reference, and take a look at the last part of the example for customizing a tab bar.

I already tried it with styles but i cannot find the right name for not selected or hovered

The Close Button tag is:

  1. QTabBar::close-button

while the Tabs use

  1. QTabBar::tab:selected

and
  1. QTabBar::tab:hover

October 28, 2011

Andre Andre
Area 51 Engineer
6076 posts

Shouldn’t the last be

  1. QTabBar::tab:hover

?

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

October 28, 2011

wamo wamo
Lab Rat
21 posts
Andre wrote:
Shouldn’t the last be
  1. QTabBar::tab:hover
?

Right.

 
  ‹‹ QGraphicsScene - not updated after QGraphicsItem moved      [SOLVED] How can i set the background color of listwidget item using rgb values? ››

You must log in to post a reply. Not a member yet? Register here!