From f38c453eaf02ff9635d17f8a2ea8a1b22594aef5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Sep 2018 08:17:30 +0530 Subject: [PATCH] ... --- src/calibre/gui2/comments_editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index dbef2c5707..576d2591d1 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -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', '\t')