예제 #1
0
 def keyPressEvent(self, ev):
     k = ev.key()
     if k == Qt.Key_Escape:
         self.abort_search.emit()
         ev.accept()
         return
     if k in (Qt.Key_Enter, Qt.Key_Return):
         text = self.text()
         self.editingFinished.emit()
         self.do_search.emit(text, self.search_forward)
         return
     return QLineEdit.keyPressEvent(self, ev)
예제 #2
0
 def keyPressEvent(self, ev):
     k = ev.key()
     if k == Qt.Key_Escape:
         self.abort_search.emit()
         ev.accept()
         return
     if k in (Qt.Key_Enter, Qt.Key_Return):
         text = self.text()
         self.editingFinished.emit()
         self.do_search.emit(text, self.search_forward)
         return
     return QLineEdit.keyPressEvent(self, ev)
예제 #3
0
파일: ask.py 프로젝트: alok/vise
 def keyPressEvent(self, ev):
     if ev.matches(QKeySequence.Copy):
         from .commands.open import Open
         cmd, rest = self.text().partition(' ')[::2]
         if cmd in Open.names and rest.strip():
             QApplication.clipboard().setText(rest)
             ev.accept()
             return
     k = ev.key()
     mods = ev.modifiers()
     if k in (Qt.Key_V, Qt.Key_S) and mods & Qt.CTRL and mods & Qt.SHIFT:
         text = QApplication.clipboard().text(k == Qt.Key_S)
         if text:
             self.setText(text)
     return QLineEdit.keyPressEvent(self, ev)
예제 #4
0
파일: ask.py 프로젝트: kovidgoyal/vise
 def keyPressEvent(self, ev):
     if ev.matches(QKeySequence.Copy):
         from .commands.open import Open
         cmd, rest = self.text().partition(' ')[::2]
         if cmd in Open.names and rest.strip():
             QApplication.clipboard().setText(rest)
             ev.accept()
             return
     k = ev.key()
     mods = ev.modifiers()
     if k in (Qt.Key_V, Qt.Key_S) and mods & Qt.CTRL and mods & Qt.SHIFT:
         text = QApplication.clipboard().text(k == Qt.Key_S)
         if text:
             self.setText(text)
     return QLineEdit.keyPressEvent(self, ev)
예제 #5
0
 def keyPressEvent(self, event):
     self.key_pressed.emit(event)
     QLineEdit.keyPressEvent(self, event)
예제 #6
0
파일: search_box.py 프로젝트: tokot/calibre
 def keyPressEvent(self, event):
     self.key_pressed.emit(event)
     QLineEdit.keyPressEvent(self, event)