On 6/13/2012 11:51 AM, Konrad Rosenbaum wrote:
Hi,
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.
Konrad
The documentation for QItemDelegate,
http://qt-project.org/doc/qt-4.8/qitemdelegate.html#details, indicates I
should use QStyledItemDelegate
<http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html>:
Detailed Description
....
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?
Thanks,
Carl Schumann
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest