0

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

warunanc
  • 2,221
  • 1
  • 23
  • 40

2 Answers2

1

This cannot be done at Qt Style-Sheet level

warunanc
  • 2,221
  • 1
  • 23
  • 40
0

I have a idea,probably not so well. You can use the interface QTreeWidget::setItemWidget(QTreeWidgetItem *item, int column, QWidget *widget). Then customize your widget(Everything you want).

DaCapo
  • 1
  • 2