class myDelegate : public QItemDelegate{ ... protected: virtual void drawDisplay ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QString & text ) const { QTextDocument doc; doc.setHtml(text); QPixmap pix(rect.size()); QPainter p(&pix); p.setPen(Qt::NoPen); if (option.state & QStyle::State_Selected) p.setBrush(option.palette.highlight()); else p.setBrush(option.palette.base()); p.fillRect (pix.rect(), p.brush()); doc.drawContents(&p, pix.rect()); painter->drawPixmap(rect.x(), rect.y(), pix); }};