Changeset 10475
- Timestamp:
- 04/28/11 11:06:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/HtmlDelegate.cc
r10398 r10475 7 7 { 8 8 QTextDocument doc; 9 doc.setPageSize(option.rect.size()); 9 10 doc.setHtml(index.data().toString()); 11 12 // === This can be used if a scrolling is needed === 13 // painter->save(); 14 // painter->translate(option.rect.topLeft()); 15 // QRect r(QPoint(0, 0), option.rect.size()); 16 // doc.drawContents(painter, r); 17 // painter->restore(); 18 // drawFocus(painter, option, option.rect); 19 10 20 doc.drawContents(painter, option.rect); 11 21 } 12 22 13 QSize HtmlDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex &index) const23 QSize HtmlDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const 14 24 { 15 25 QTextDocument doc; 26 doc.setPageSize(option.rect.size()); 16 27 doc.setHtml(index.data().toString()); 17 28 return doc.size().toSize();
Note:
See TracChangeset
for help on using the changeset viewer.