Hello!

I'm trying to implement something similar what you can see here http://crunchbang.org/uploads/103007035559-tracker.gif.

But below the category rows (gray background) should be a treeview.

I started to use a TreeView for all that stuff. That is, my first level children (deep 1) are the categories (gray row). Therefore I used setFirstColumnSpanned() of the tree view for these rows. Now I wanted to highlight these category rows with a different background similar to the screenshout. I created a delegate.

The problem is: How can I say that the delegate only should be used for the category item?
  • setItemDelegate() will setup the delegate for all items
  • setItemDelegateForRow() will setup the delegate for ALL items of a certain row (but independant of the level! that is, also in a deep level I would have the delegate because the row number matches)


Writing this an other idea comes to my mind. I could use the same delegate for all items, but in the paint() method of the delegate I would just look wheter the model index is from the first level. But this would'nt be that efficient?

Is there another way? What about a vertical layout and every second row (of this layout!) is a treeview widget. The other rows are categories...some custom widget. But in the end the category rows should be clickable, so that the treeview can be hidden. And drag and drop between the rows should also be possible etc...

Another related problem: how to hide the branches (and the small clickable stuff for expanding) only for the first level?

Any hint how to proceed?