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/QTabBar
Forum Updated to NodeBB v4.3 + New Features

QTabWidget/QTabBar

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 5.6k 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.
  • F Offline
    F Offline
    f.vanalmetelevic.com
    wrote on last edited by
    #1

    I want to add an different image to each of the tabs of my tab widget. I could do the setting of an image using style sheets :

    @QTabBar::tab {
    background-image: url(:/Images/medication.png);
    }@

    But this applies to all tabs. How do I select each tab of a tabbar separately?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VC15
      wrote on last edited by
      #2

      You can use @int QTabBar::addTab ( const QIcon & icon, const QString & text); @

      1 Reply Last reply
      0
      • F Offline
        F Offline
        f.vanalmetelevic.com
        wrote on last edited by
        #3

        I would like to do it in the style sheet editor in designer mode. Is it possible ?

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          [quote author="filipv" date="1284641514"]I would like to do it in the style sheet editor in designer mode. Is it possible ?[/quote]

          Might not be possible directly using style sheet. Is your intention to avoid writing code? If so, then you can use the designer and specify individual icons for the tabs using the "CurrentTabIcon" property of the QTabWidget in the designer. Is that what you were looking for?

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            [quote author="filipv" date="1284636041"]I want to add an different image to each of the tabs of my tab widget. I could do the setting of an image using style sheets :

            @QTabBar::tab {
            background-image: url(:/Images/medication.png);
            }@

            But this applies to all tabs. How do I select each tab of a tabbar separately?[/quote]

            Your original question was it to set background image to each tab page or is it to set individual icons for each tab page?

            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