Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.6, 5.15.0
-
None
Description
When a QTabWidget is used where the QTabBar only contains icons, the tabBarTabs are too wide. This was still ok in Qt 5.6.0, but after upgrading to Qt 5.12.6 we found this issue. (also 5.15.0 has the same problem)
In attachment:
- A minimal project that demonstrates the problem
- In Wrong.png you find the result of Qt 5.12.6
- in Correct.png you find the result we had before.
I suspect this issue got introduced in https://code.qt.io/cgit/qt/qtbase.git/commit/src/widgets/styles/qmacstyle_mac.mm?h=5.9&id=175f33ed855b0a8a30daafacd4f48fa3f8e76a9b
In QMacStyle::sizeFromContents() the calculation for QStyle::CT_TabBarTab was changed: extraHSpace is added when an icon is present.
The workaround I use is to create a QProxyStyle where I calculate the size for QStyle::CT_TabBarTab myself.