Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.0
-
None
-
All platforms & hardware.
Description
In qstylesheet.cpp:4764
case PE_IndicatorBranch: if (const QStyleOptionViewItem {*}vopt = qstyleoption_cast<const QStyleOptionViewItem{*}>(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch); if (subRule.hasDrawable()) { proxy()->drawPrimitive(PE_PanelItemViewRow, vopt, p, w); subRule.drawRule(p, opt->rect); } else { baseStyle()->drawPrimitive(pe, vopt, p, w); } }
Here,
proxy()->drawPrimitive(PE_PanelItemViewRow...)
is drawing with the ItemView style. This results in quite odd behavior when using a stylesheet such as:
QTreeView::item { background: grey; border: 1px solid black; border-radius: 4px; } QTreeView::branch:open:has-children { image: url(:/creator/images/controls/light/down-caret-black.svg); background-color: transparent; }
Because of the above styling, the branch indicator will draw with a grey background and solid black 4px rounded border. Certainly not what the stylesheet author intended!
This could easily be amended by just removing the
proxy()->drawPrimitive(PE_PanelItemViewRow...)
line entirely - or by drawing with
PE_IndicatorBranch
instead.
I've attached a photo with the issue.