From 01c47148e91788c1af3e7258f35abe9fa24271a3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Nov 2018 09:17:46 +0530 Subject: [PATCH] ... --- src/calibre/gui2/complete2.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 594758043e..18d5a79883 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -353,9 +353,12 @@ class LineEdit(QLineEdit, LineEditECM): def event(self, ev): # See https://bugreports.qt.io/browse/QTBUG-46911 - if ev.type() == ev.ShortcutOverride and ( - ev.key() in (Qt.Key_Left, Qt.Key_Right) and (ev.modifiers() & ~Qt.KeypadModifier) == Qt.ControlModifier): - ev.accept() + try: + if ev.type() == ev.ShortcutOverride and ( + ev.key() in (Qt.Key_Left, Qt.Key_Right) and (ev.modifiers() & ~Qt.KeypadModifier) == Qt.ControlModifier): + ev.accept() + except AttributeError: + pass return QLineEdit.event(self, ev) def complete(self, show_all=False, select_first=True):