Skip to content

Commit

Permalink
Merge 719fc5c into a74824d
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsebgosselin committed Nov 12, 2019
2 parents a74824d + 719fc5c commit 373cb13
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spyder/widgets/helperwidgets.py
Expand Up @@ -110,6 +110,7 @@ class HTMLDelegate(QStyledItemDelegate):
Taken from https://stackoverflow.com/a/5443112/2399799
"""

def __init__(self, parent, margin=0):
super(HTMLDelegate, self).__init__(parent)
self._margin = margin
Expand All @@ -127,11 +128,12 @@ def _prepare_text_document(self, option, index):
def paint(self, painter, option, index):
options, doc = self._prepare_text_document(option, index)

style = (QApplication.style() if options.widget is None
else options.widget.style())

widget = (QApplication.instance() if options.widget is None
else options.widget)
style = widget.style()
options.text = ""
style.drawControl(QStyle.CE_ItemViewItem, options, painter)
style.drawControl(QStyle.CE_ItemViewItem, options, painter,
options.widget)

ctx = QAbstractTextDocumentLayout.PaintContext()

Expand Down

0 comments on commit 373cb13

Please sign in to comment.