Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.2.1, 5.3.0
-
Mac OSX 10.9
Description
Cannot set the font for QHeaderView or QHeaderView::section on Mac OSX 10.9 with Qt 5.2.1
Suggested fix ...
In file qmacstyle_mac.mm, near line 3398, comment out the line beginning with p->setFont(...
Current 5.2.1 code:
p->setFont(qt_app_fonts_hash()->value("QSmallFont", QFont()));
proxy()->drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette, header->state & State_Enabled, header->text, QPalette::ButtonText);
p->restore();
Fixed code:
//p->setFont(qt_app_fonts_hash()->value("QSmallFont", QFont()));
proxy()->drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette, header->state & State_Enabled, header->text, QPalette::ButtonText);
p->restore();
In qstylesheet.cpp, near line 3734, Add || subRule.hasFont to if condition
Current 5.2.1 code:
if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw() || subRule.hasBackground() || subRule.hasPalette()) { ParentStyle::drawControl(ce, opt, p, w); return;
Fixed code:
if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw() || subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont) { ParentStyle::drawControl(ce, opt, p, w); return;
Attachments
Issue Links
- replaces
-
QTBUG-33855 Cannot change font size for QTableWidget header in Qt 5.1.1
-
- Closed
-
For Gerrit Dashboard: QTBUG-37153 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
144259,2 | QHeaderView and others: Fix font lookup name | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |
144260,3 | Style sheets: detect and use font set on QHeaderViews | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |
144382,3 | QHeaderView: Reset cached section sizes on font and style change | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |