def event(self, ev): if ev.type() == ev.ShortcutOverride and ev in (QKeySequence.Copy, QKeySequence.Cut): ev.accept() (self.copy if ev == QKeySequence.Copy else self.cut)() return True return QPlainTextEdit.event(self, ev)
def event(self, ev): et = ev.type() if et == ev.ToolTip: self.show_tooltip(ev) return True if et == ev.ShortcutOverride: ret = self.override_shortcut(ev) if ret: return True return QPlainTextEdit.event(self, ev)
def event(self, ev): if ev.type() == ev.ToolTip: self.show_tooltip(ev) return True if ev.type() == ev.ShortcutOverride: # Let the global cut/copy/paste/undo/redo shortcuts work, this avoids the nbsp # problem as well, since they use the overridden copy() method # instead of the one from Qt, and allows proper customization # of the shortcuts if ev in (QKeySequence.Copy, QKeySequence.Cut, QKeySequence.Paste, QKeySequence.Undo, QKeySequence.Redo): ev.ignore() return True # This is used to convert typed hex codes into unicode # characters if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier: ev.accept() return True return QPlainTextEdit.event(self, ev)
def event(self, ev): if ev.type() == ev.ToolTip: self.show_tooltip(ev) return True if ev.type() == ev.ShortcutOverride: if ev in ( # Let the global cut/copy/paste shortcuts work,this avoids the nbsp # problem as well, since they use the overridden copy() method # instead of the one from Qt QKeySequence.Copy, QKeySequence.Cut, QKeySequence.Paste, ) or ( # This is used to convert typed hex codes into unicode # characters ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier ): ev.ignore() return False return QPlainTextEdit.event(self, ev)
def event(self, ev): return QPlainTextEdit.event(self, ev)