Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTabWidget: different close image for selected Tab
Forum Updated to NodeBB v4.3 + New Features

QTabWidget: different close image for selected Tab

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wamo
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wamo
        wrote on last edited by
        #3

        [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@

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wamo
            wrote on last edited by
            #5

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

            Right.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved