From d515902e90c34fa27985ed590840f292775d75b7 2013-03-31 17:38:58 From: Min RK Date: 2013-03-31 17:38:58 Subject: [PATCH] Merge pull request #3097 from minrk/qt-4.10 PyQt 4.10: use self._document = self.document() closes #3084 I have tested this on all my machines with earlier PyQt and PySide, and it doesn't break anything. I don't have any truly old versions of PyQt, though. see PyQt list for details. --- diff --git a/IPython/frontend/qt/console/pygments_highlighter.py b/IPython/frontend/qt/console/pygments_highlighter.py index 7d54c74..6e40f46 100644 --- a/IPython/frontend/qt/console/pygments_highlighter.py +++ b/IPython/frontend/qt/console/pygments_highlighter.py @@ -94,7 +94,7 @@ class PygmentsHighlighter(QtGui.QSyntaxHighlighter): def __init__(self, parent, lexer=None): super(PygmentsHighlighter, self).__init__(parent) - self._document = QtGui.QTextDocument() + self._document = self.document() self._formatter = HtmlFormatter(nowrap=True) self._lexer = lexer if lexer else PythonLexer() self.set_style('default')