QTreeWidget (Applying Styles for items)

大兔子大兔子 提交于 2019-12-08 09:08:39

问题


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:


This cannot be done at Qt Style-Sheet level



来源:https://stackoverflow.com/questions/13074643/qtreewidget-applying-styles-for-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!