I have a QTreeView in my application, where I need to draw borders around every cell. If I set my style like this:
QTreeView::item
{
border-right: 1px solid #6d6d6d;
border-bottom: 1px solid #6d6d6d;
border-left: none;
border-top: none;
}
The border does not appear under the branch sub-control:
If I set the border on the branch area:
QTreeView::branch
{
border-bottom: 1px solid #6d6d6d;
}
Then the branch image (triangle) disappears.
Ideally, I would like to set the border from the style.
Thanks!
Found it: image and background-image work for branches and can be combined with border-image:
QTreeView::branch
{
border-bottom: 1px solid #6d6d6d;
}
QTreeView::branch:closed:has-children
{
image: url(:/img/collapsed);
}
QTreeView::branch:open
{
image: url(:/img/expanded);
}