QTreeView branch drawing... missing branch?
-
Hey
So I've run in to alittle bit of a hiccup...
I'm using custom QStyledItemDelegate on my QTreeView, and I think it caused some issues...
When I draw my items I'm missing alternativeBackgroundColors + vertical branch line without anything next to it...
A standard QTreeView renders properly :
I literally have no idea how to dig in to it... any hints? :- ))))
TIA
QTreeView::branch:has-siblings:!adjoins-item { background: white; border-image: none; image: none; } QTreeView::branch:has-siblings:adjoins-item { background: white; border-image: none; image: none; } QTreeView::branch:!has-children:!has-siblings:adjoins-item { background: white; border-image: none; image: none; } QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings { background: white; border-image: none; } QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-children:has-siblings { background: white; border-image: none; }
Running this code result in :
I'm not getting any of the has-siblings:adjoins-item / etc items.
-
Hi,
A good starting point would be to share your delegate code. That way more eyes may spot what is going wrong.
-
@SGaist said in QTreeView branch drawing... missing branch?:
Hi,
A good starting point would be to share your delegate code. That way more eyes may spot what is going wrong.
Hey
Apology for the long delay. Had a wild run around the app hotfixing bunch of stuff...
As far as I can tell adding this >
QTreeView::branch { border-image: none 0; image: none 0; }
Fixed the issue, no idea why :- ) Or what does the 0 at the end do...
But it works :D - unless it breaks something else that I dont know about yet :D
TIa
-
In fact, it's the QTreeView::drawBranch that handles that.