[Interest] [Development] Multicolored text in a QTableView cell?

Konrad Rosenbaum konrad at silmor.de
Wed Jun 13 18:51:12 CEST 2012


On Wednesday 13 June 2012 17:27:20 Carl Schumann wrote:
> Where MccModel subclassed from QAbstractTableModel.    This did not
> work, specifically it displayed the whole long rich text string in
> black.   How should I be doing multicolored table cells please?

Use a custom delegate instead: derive a class from QItemDelegate and override 
the paint method to do your custom drawing. If you want to use rich text you 
can for example use QTextDocument::drawContents as a helper.

-------------- 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/20120613/1f57640e/attachment.sig>

More information about the Interest mailing list