Results 1 to 4 of 4

Thread: QTabWidget tab title left/right clearance

  1. #1
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1

    Default QTabWidget tab title left/right clearance

    Hello,

    How to change the tab title left/right clearance, I need to reduce the width of the tab title to fit the text without any left/right clearance, it seems like the default clearance is 2-3 characters from each side. What is the style sheet property that affect the clearance. Anybody had this issue?

    Thanks

  2. #2
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QTabWidget tab title left/right clearance

    Do you use bold font for your tab text? I had similar problems log time ago and it was a bug in Qt preventing QTabBar tabs with bold text from correct text-size calculations.
    Oleg Shparber

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1

    Question Re: QTabWidget tab title left/right clearance

    Oleg,

    Thanks for your post.

    No, I am using regular font. The tab is too big for the text, i couldn't find a way to reduce it
    ------------------------
    | tab1 | tab2 | tab3 |
    -----------------------
    | | (tab1 clearance)

    Is there a way to reduce tabs clearance to look like this
    ---------------
    |tab1|tab2|tab3|
    ----------------

    Thanks

  4. #4
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QTabWidget tab title left/right clearance

    You can reimplement QTabBar::tabSizeHint to get needed behaviour.
    Oleg Shparber

  5. The following user says thank you to Oleg for this useful post:

    fady.seif (3rd August 2012)

Similar Threads

  1. How to remove the default menu on the left side of the title bar - Qt?
    By TheIndependentAquarius in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2012, 10:10
  2. how to set title on the top-left corner of QFrame?
    By weixj2003ld in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2011, 04:58
  3. Window Title Text left alignment issue.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2010, 14:46
  4. Replies: 0
    Last Post: 6th September 2009, 21:58
  5. [QTabWidget] horizontal text on left side
    By Boy in forum Qt Programming
    Replies: 6
    Last Post: 16th May 2008, 08:52

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.