I have a multi hierarchy QTreeView (currently 3 levels, will be more depends),
I created 3 different delegates (delegate A/B/C) for each level
But how do I apply the delegate to the QTreeView properly?
The following pic shows what I want:

Qt Code:
  1. >Row 0 -------------------- delegate A
  2. >Row 1 -------------------- delegate A
  3.  
  4. ^Row 2 -------------------- delegate A
  5. ^Row 20 ----------------- delegate B
  6. Row 200 -------------- delegate C
  7. Row 201 -------------- delegate C
  8. Row 202 -------------- delegate C
  9.  
  10. ^Row 21 ----------------- delegate B
  11. Row 210 -------------- delegate C
  12. Row 211 -------------- delegate C
  13. Row 212 -------------- delegate C
To copy to clipboard, switch view to plain text mode 

This function:
QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate * delegate);

With this function, I can only assign the delegate for the first level of the TreeView.
And its children (level 2, level 3) are gonna share the same delegate with level 1

How do I assign the delegate B to Row 20 and Row 21?
How do I assign the delegate C to Row 200, Row 201, Row 202......