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



  • 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.



  • [quote author="Andre" date="1319794148"]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.[/quote]

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

    The Close Button tag is:

    @QTabBar::close-button@

    while the Tabs use

    @QTabBar::tab:selected@
    and
    @QTabBar::tab:hover@



  • Shouldn't the last be
    @
    QTabBar::tab:hover
    @
    ?



  • [quote author="Andre" date="1319795356"]Shouldn't the last be
    @
    QTabBar::tab:hover
    @
    ?
    [/quote]

    Right.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.