Fix #1404234 [Icon not showing on Comments custom column](https://bugs.launchpad.net/calibre/+bug/1404234)

This commit is contained in:
Kovid Goyal 2014-12-20 09:12:29 +05:30
parent c7b18b6373
commit 9339ed74f1

View File

@ -416,6 +416,11 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{
else option.widget.style()
self.document.setHtml(option.text)
style.drawPrimitive(QStyle.PE_PanelItemViewItem, option, painter, widget=option.widget)
rect = style.subElementRect(QStyle.SE_ItemViewItemDecoration, option)
ic = option.icon
if rect.isValid() and not ic.isNull():
sz = ic.actualSize(option.decorationSize)
painter.drawPixmap(rect.topLeft(), ic.pixmap(sz))
ctx = QAbstractTextDocumentLayout.PaintContext()
ctx.palette = option.palette
if option.state & QStyle.State_Selected: