QTreeWidget (Applying Styles for items)

2019-06-13 18:56发布

I have a tree widget and there are three levels in the tree as follows

Example Tree
============================
LEVEL1
    LEVEL2
    LEVEL2
       LEVEL3
       LEVEL3
    LEVEL2
    LEVEL2
LEVEL1

I want to apply different styles for items, depending their levels so that I can style, LEVEL1, LEVEL2 & LEVEL3 differently. I can do this with a two level tree. Please help. I want to achieve this at CSS level (without touching the code)

I went through following documenation. I guess distinguishing between LEVEL1 & LEVEL2 is the hard part.

http://doc.qt.digia.com/main-snapshot/stylesheet-examples.html#customizing-qtreeview

1条回答
小情绪 Triste *
2楼-- · 2019-06-13 19:19

This cannot be done at Qt Style-Sheet level

查看更多
登录 后发表回答