PDA

View Full Version : QTabWidget tab title left/right clearance



fady.seif
1st August 2012, 15:59
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

Oleg
2nd August 2012, 11:24
Do you use bold font for your tab text? I had similar problems log time ago and it was a bug (https://bugreports.qt-project.org/browse/QTBUG-8209) in Qt preventing QTabBar tabs with bold text from correct text-size calculations.

fady.seif
2nd August 2012, 14:39
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

Oleg
2nd August 2012, 14:53
You can reimplement QTabBar::tabSizeHint to get needed behaviour.