def paint(self, painter, option, index):
if not index.isValid():
return
options = QStyleOptionViewItemV4(option)
self.initStyleOption(options, index)
painter.save()
painter.
setRenderHint(QPainter.
Antialiasing,
True) doc.setHtml(options.text)
options.text = ""
options.
widget.
style().
drawControl(QStyle.
CE_ItemViewItem, options, painter, options.
widget) painter.translate(options.rect.left(), options.rect.top())
rect
= QRectF(0,
0, options.
rect.
width(), options.
rect.
height()) doc.drawContents(painter, rect)
painter.restore()
def paint(self, painter, option, index):
if not index.isValid():
return
options = QStyleOptionViewItemV4(option)
self.initStyleOption(options, index)
painter.save()
painter.setRenderHint(QPainter.Antialiasing, True)
doc = QTextDocument()
doc.setHtml(options.text)
options.text = ""
options.widget.style().drawControl(QStyle.CE_ItemViewItem, options, painter, options.widget)
painter.translate(options.rect.left(), options.rect.top())
rect = QRectF(0, 0, options.rect.width(), options.rect.height())
doc.drawContents(painter, rect)
painter.restore()
To copy to clipboard, switch view to plain text mode
Bookmarks