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 4 Oct 2016, 06:01 last edited by Sebbo 10 Apr 2016, 06:03
    #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!!

    R 1 Reply Last reply 4 Oct 2016, 06:04
    0
    • S Sebbo
      4 Oct 2016, 06:01

      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!!

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 4 Oct 2016, 06:04 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 4 Oct 2016, 06:20
      2
      • R raven-worx
        4 Oct 2016, 06:04

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

        S Offline
        S Offline
        Sebbo
        wrote on 4 Oct 2016, 06:20 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?

        R 1 Reply Last reply 4 Oct 2016, 07:55
        0
        • S Sebbo
          4 Oct 2016, 06:20

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

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 4 Oct 2016, 07:55 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 4 Oct 2016, 08:23
          2
          • R raven-worx
            4 Oct 2016, 07:55

            @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 4 Oct 2016, 08:23 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

            1/5

            4 Oct 2016, 06:01

            • Login

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