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: style each tab differently
QtWS25 Last Chance

QTabWidget: style each tab differently

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtabwidgetqtabbarstylec++qt5
5 Posts 2 Posters 2.4k Views
  • 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.
  • S Offline
    S Offline
    Sebbo
    wrote on last edited by Sebbo
    #1

    Hi everyone,

    is it possible to style each tab of a QTabWidget differently (while using e.g. the tabindex) as the individual tabs are widgets?
    The setStyleSheet option only styles the whole QTabBar apart from using different states (:only-one, :first, :last, :middle, :previous-selected, :next-selected, :selected) which won't work in my case.

    Thanks!!

    raven-worxR 1 Reply Last reply
    0
    • S Sebbo

      Hi everyone,

      is it possible to style each tab of a QTabWidget differently (while using e.g. the tabindex) as the individual tabs are widgets?
      The setStyleSheet option only styles the whole QTabBar apart from using different states (:only-one, :first, :last, :middle, :previous-selected, :next-selected, :selected) which won't work in my case.

      Thanks!!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Sebbo
      short answer: no.
      Unfortunately that's not possible.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      S 1 Reply Last reply
      2
      • raven-worxR raven-worx

        @Sebbo
        short answer: no.
        Unfortunately that's not possible.

        S Offline
        S Offline
        Sebbo
        wrote on last edited by
        #3

        @raven-worx
        thanks for your answer.
        Well that's disappointing. I'd like to change the appearance e.g. when an event is fired. Otherwise I wouldn't recognize any changes in the different widgets. Is there any other way to achieve that? Like jumping to the desired tab by using the index?

        raven-worxR 1 Reply Last reply
        0
        • S Sebbo

          @raven-worx
          thanks for your answer.
          Well that's disappointing. I'd like to change the appearance e.g. when an event is fired. Otherwise I wouldn't recognize any changes in the different widgets. Is there any other way to achieve that? Like jumping to the desired tab by using the index?

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Sebbo said in QTabWidget: style each tab differently:

          Like jumping to the desired tab by using the index?

          QTabWidget::setCurrentIndex()

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          S 1 Reply Last reply
          2
          • raven-worxR raven-worx

            @Sebbo said in QTabWidget: style each tab differently:

            Like jumping to the desired tab by using the index?

            QTabWidget::setCurrentIndex()

            S Offline
            S Offline
            Sebbo
            wrote on last edited by
            #5

            @raven-worx
            ah right, couldn't be easier. :)
            Maybe I'll come up with another solution for my issue like subclassing and repainting the tabbar. For now that'll do the trick.
            Cheers

            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