Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How can set tab width size on each tab?

    General and Desktop
    qt 5.4.1
    2
    3
    1127
    Loading More Posts
    • 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.
    • darongyi
      darongyi last edited by

      I make tabwidget and put image each tabs.
      Tab width doesn't fit icon size.
      Icon size also change size.
      That's my blog site. I upload code and compile window.

      Put Icon on Qt Tab Bar

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        Did you try setIconSize(...) ?

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 4
        • darongyi
          darongyi last edited by

          Thank you .. I make code like this.
          Draw well.

           QSize tabSizeHint(int index) const
              {
                  QSize m_size;
                 if( index==0)
                 {
                   m_size= QSize(94,50);
                  }
                   else if(index==1)
                 {
                     m_size= QSize(113,50);
                  }
          
                 return m_size;
               }
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post