Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 def event(self, ev):
     if ev.type() == ev.ToolTip:
         self.show_tooltip(ev)
         return True
     if ev.type() == ev.ShortcutOverride and ev in (
         QKeySequence.Copy, QKeySequence.Cut, QKeySequence.Paste):
         # 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
         ev.ignore()
         return False
     return QPlainTextEdit.event(self, ev)
Ejemplo n.º 3
0
 def event(self, ev):
     if ev.type() == ev.ToolTip:
         self.show_tooltip(ev)
         return True
     if ev.type() == ev.ShortcutOverride and ev in (QKeySequence.Copy,
                                                    QKeySequence.Cut,
                                                    QKeySequence.Paste):
         # 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
         ev.ignore()
         return False
     return QPlainTextEdit.event(self, ev)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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)
Ejemplo n.º 7
0
 def event(self, ev):
     if ev.type() == ev.ToolTip:
         self.show_tooltip(ev)
         return True
     return QPlainTextEdit.event(self, ev)
Ejemplo n.º 8
0
 def event(self, ev):
     if ev.type() == ev.ToolTip:
         self.show_tooltip(ev)
         return True
     return QPlainTextEdit.event(self, ev)