Fix: style sheet styling of background of triangular QTabWidget tabs
The triangular tab shape is not reproducible with setting style border options, so it should be painted with the usual code path, also when a custom background has been set. Fixes: QTBUG-72096 Change-Id: I7bc1c0579386b8ea7266ce6456534c2519d9addf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
2a79af6b5c
commit
3d8ed3ba96
@ -4165,12 +4165,12 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
|
||||
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
|
||||
QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
|
||||
QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, opt->rect, opt->direction);
|
||||
if (ce == CE_TabBarTabShape && subRule.hasDrawable()) {
|
||||
if (ce == CE_TabBarTabShape && subRule.hasDrawable() && tab->shape < QTabBar::TriangularNorth) {
|
||||
subRule.drawRule(p, r);
|
||||
return;
|
||||
}
|
||||
QStyleOptionTab tabCopy(*tab);
|
||||
subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Window);
|
||||
subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Base);
|
||||
QFont oldFont = p->font();
|
||||
if (subRule.hasFont)
|
||||
p->setFont(subRule.font);
|
||||
|
Loading…
Reference in New Issue
Block a user