QTreeView stylesheet - row stylizing

  • The Qt documentation states how to "stylize QTreeView":http://qt-project.org/doc/qt-5/stylesheet-examples.html#customizing-qtreeview. Question: how to draw the top and bottom border of a QTreeView row or column?

    The following code:
    QTreeView::item {
    border: 1px solid transparent;
    border-bottom-color: red;

    imitates the desired effect but not at full extent. If the nodes of the QTreeView are expanded the greater the hierarchy level the less border is drawn at the beginning of the row. So, the bottom row border between the leftmost part of the QTreeview area and the given tree node is not drawn.

    Any suggestions how to draw the top and/or bottom border of a QTreeView's rows, so that it covers the whole row width?

Log in to reply