mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix regression that caused copying of non-breaking spaces to not work when using the keyboard shortcuts
This commit is contained in:
parent
c60d39c519
commit
4c4f74fb5d
@ -533,17 +533,16 @@ class TextEdit(PlainTextEdit):
|
|||||||
self.show_tooltip(ev)
|
self.show_tooltip(ev)
|
||||||
return True
|
return True
|
||||||
if ev.type() == ev.ShortcutOverride:
|
if ev.type() == ev.ShortcutOverride:
|
||||||
if ev in (
|
# Let the global cut/copy/paste/undo/redo shortcuts work, this avoids the nbsp
|
||||||
# Let the global cut/copy/paste/undo/redo shortcuts work,this avoids the nbsp
|
|
||||||
# problem as well, since they use the overridden copy() method
|
# problem as well, since they use the overridden copy() method
|
||||||
# instead of the one from Qt, and allows proper customization
|
# instead of the one from Qt, and allows proper customization
|
||||||
# of the shortcuts
|
# of the shortcuts
|
||||||
QKeySequence.Copy, QKeySequence.Cut, QKeySequence.Paste, QKeySequence.Undo, QKeySequence.Redo
|
if ev in (QKeySequence.Copy, QKeySequence.Cut, QKeySequence.Paste, QKeySequence.Undo, QKeySequence.Redo):
|
||||||
) or (
|
ev.ignore()
|
||||||
|
return True
|
||||||
# This is used to convert typed hex codes into unicode
|
# This is used to convert typed hex codes into unicode
|
||||||
# characters
|
# characters
|
||||||
ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier
|
if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
|
||||||
):
|
|
||||||
ev.accept()
|
ev.accept()
|
||||||
return True
|
return True
|
||||||
return QPlainTextEdit.event(self, ev)
|
return QPlainTextEdit.event(self, ev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user