PDA

View Full Version : QStyledItemDelegate update index



migel
27th August 2011, 20:35
Hi, I subclassed QStyledItemDelegate for QTreeView. I would like to update some info using paint() by emitting a signal from other object.

Could some how provide an example how can I update QStandardItem in delegate ?

Thanks

srazi
29th August 2011, 20:03
Hi,
'index' variable passed to 'QStyledItemDelegate::paint()' is a 'const' variable and you can't modify it there.
If I understand correctly, you can connect that signal to a slot and update passed QStandardItem on that slot, and then call repaint(), now 'QStyledItemDelegate::paint()' paints item with new info.