PDA

View Full Version : QTreeView, setItemDelegateForColumn



visor_ua
29th April 2008, 23:22
ItemDelegate show icons in column 0.
Is it possible for QTreeView, in parent index with column==0 to show - text, for child indexes - delegated icons.

wysota
29th April 2008, 23:44
As far as I understand what you mean - yes and you don't need a custom delegate for it, the default will do just fine provided that the model returns proper data for proper roles. It would be advised to explain what you mean though as I might have misunderstood you.

visor_ua
30th April 2008, 00:00
tree has structure:
-date
---info icons, other columns.
Not problem to use DecorationRole to show one icon. But need to show few images

visor_ua
30th April 2008, 00:22
Solved, in paint for delegate analysing is parent == QModelIndex(). If so - drawText, in other case - drawing pictures.