[Qt-interest] Custom delegate only for certain items

RZ rz at razfazz.at
Thu Jun 11 23:20:35 CEST 2009


Hi,

QTreeView offers setItemDelegate, setItemDelegateForRow and 
setItemDelegateForColumn. But I need my delegate (a QComboBox) only for 
certain items.
My QTreeView got 2 columns, many rows - items in the second column are 
not editable for the user. Items in column 0 are editable - but only 
items in the third hierarchy level shall use the custom delegate.

ItemType1                       editable but no custom delegate
|   |
|   - - - ItemType2             editable but no custom delegate
|             |
|             - - - ItemType3   use the delegate
|             |
|             - - - ItemType3   use the delegate
|
ItemType1                       editable but no custom delegate
     |
     - - - ItemType2             editable but no custom delegate
               |
               - - - ItemType3   use the delegate
               |
               - - - ItemType3   use the delegate
               |
               - - - ItemType3   use the delegate


If i got everything correctly each block of items is on the same row (so 
setItemDelegateForRow won't help) and they are in the same column (so 
setItemdelegateForColumn doesn't help).

Has someone got an idea how to solve that?

Thx in advance,

RZ



More information about the Qt-interest-old mailing list