QHeaderView: honor qss padding attribute

QStyleSheetStyle did not check if a border (which includes the padding)
is given and therefore the padding attribute given by css was ignored.
Only when another attribute was additionally set, the padding was used.

Task-number: QTBUG-59501
Change-Id: If3e691a23266ef6d0fb942a43053b29d65e40047
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
Christian Ehrlicher 2018-08-31 23:44:15 +02:00
parent 20be62da8c
commit 6c088af0f9

View File

@ -3870,7 +3870,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if(hasStyleRule(w, PseudoElement_HeaderViewSection)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw()
|| subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont) {
|| subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont || subRule.hasBorder()) {
ParentStyle::drawControl(ce, opt, p, w);
return;
}