This commit is contained in:
Kovid Goyal 2018-09-29 08:17:30 +05:30
parent 86671138dc
commit f38c453eaf
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -412,7 +412,7 @@ class EditorWidget(QWebView, LineEditECM): # {{{
self.page().setContentEditable(not self.readonly)
def event(self, ev):
if ev.type() in (ev.KeyPress, ev.KeyRelease, ev.ShortcutOverride) and ev.key() in (
if ev.type() in (ev.KeyPress, ev.KeyRelease, ev.ShortcutOverride) and hasattr(ev, 'key') and ev.key() in (
Qt.Key_Tab, Qt.Key_Escape, Qt.Key_Backtab):
if (ev.key() == Qt.Key_Tab and ev.modifiers() & Qt.ControlModifier and ev.type() == ev.KeyPress):
self.exec_command('insertHTML', '<span style="white-space:pre">\t</span>')