mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix Cmd+Left/Right keyboard shortcut not working when editing items in the book list on OS X. Fixes #1469554 [Keyboard navigation when editing fields in main window](https://bugs.launchpad.net/calibre/+bug/1469554)
Workaround for yet another Qt OSX bug. https://bugreports.qt.io/browse/QTBUG-46911
This commit is contained in:
parent
7875a3de4f
commit
dcf48d9945
@ -340,6 +340,13 @@ class LineEdit(QLineEdit, LineEditECM):
|
||||
return property(fget=fget, fset=fset)
|
||||
# }}}
|
||||
|
||||
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()
|
||||
return QLineEdit.event(self, ev)
|
||||
|
||||
def complete(self, show_all=False, select_first=True):
|
||||
orig = None
|
||||
if show_all:
|
||||
|
@ -480,7 +480,13 @@ class EnLineEdit(LineEditECM, QLineEdit): # {{{
|
||||
Includes an extended content menu.
|
||||
'''
|
||||
|
||||
pass
|
||||
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()
|
||||
return QLineEdit.event(self, ev)
|
||||
|
||||
# }}}
|
||||
|
||||
class ItemsCompleter(QCompleter): # {{{
|
||||
|
Loading…
x
Reference in New Issue
Block a user