11 #include <QTextDocument> 13 void HtmlDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const 16 doc.setPageSize(option.rect.size());
17 doc.setHtml(index.data().toString());
27 doc.drawContents(painter, option.rect);
33 doc.setPageSize(option.rect.size());
34 doc.setHtml(index.data().toString());
35 return doc.size().toSize();
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const