[Interest] Multicolored text in a QTableView cell?

Konrad Rosenbaum konrad at silmor.de
Thu Jun 14 09:23:09 CEST 2012


On Wednesday 13 June 2012 23:44:35 you wrote:
> > The QItemDelegate class is one of the Model/View Classes and is part
> > of Qt's model/view framework. Note that QStyledItemDelegate has taken
> > over the job of drawing Qt's item views. We recommend the use of
> > QStyledItemDelegate when creating new delegates.
> 
> So should I really be using QStyledItemDelegate please?

Since the docs indicate it: yes, you should.

Actually it depends on how much you plan to override. 

If you just want to change behaviour for one specific column or data type then 
using QStyledItemDelegate is the preferred way, since it respects the current 
Qt style for everything you leave to the original implementation. 

If you want to do all painting yourself and only leave the editor widgets to 
the delegate, using QItemDelegate may be more light-weight. It may also be 
preferred if you want the widget to be style-agnostic (or rather style-
ignorant) - i.e. you want it to look the same no matter what idiotic style 
settings the user chose.

If you want to override everything, forget about those and derive from 
QAbstractItemDelegate directly.

YMMV


	Konrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120614/789b8d03/attachment.sig>


More information about the Interest mailing list