コード例 #1
0
ファイル: char_select.py プロジェクト: artbycrunk/calibre
 def char_selected(self, c):
     if QApplication.keyboardModifiers() & Qt.CTRL:
         self.hide()
     if self.parent() is None or self.parent().focusWidget() is None:
         QApplication.clipboard().setText(c)
         return
     self.parent().activateWindow()
     w = self.parent().focusWidget()
     e = QInputMethodEvent('', [])
     e.setCommitString(c)
     if hasattr(w, 'no_popup'):
         oval = w.no_popup
         w.no_popup = True
     QApplication.sendEvent(w, e)
     if hasattr(w, 'no_popup'):
         w.no_popup = oval
コード例 #2
0
ファイル: char_select.py プロジェクト: yipeng0428/calibre
 def char_selected(self, c):
     if QApplication.keyboardModifiers() & Qt.Modifier.CTRL:
         self.hide()
     if self.parent() is None or self.parent().focusWidget() is None:
         QApplication.clipboard().setText(c)
         return
     self.parent().activateWindow()
     w = self.parent().focusWidget()
     e = QInputMethodEvent('', [])
     e.setCommitString(c)
     if hasattr(w, 'no_popup'):
         oval = w.no_popup
         w.no_popup = True
     QApplication.sendEvent(w, e)
     if hasattr(w, 'no_popup'):
         w.no_popup = oval