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
-