def keyPressEvent( self, event ): ( modifier, key ) = ClientGUIShortcuts.ConvertKeyEventToSimpleTuple( event ) if key == QC.Qt.Key_Escape: self.done( QW.QDialog.Rejected ) else: QP.Dialog.keyPressEvent( self, event )
def keyPressEvent( self, event ): ( modifier, key ) = ClientGUIShortcuts.ConvertKeyEventToSimpleTuple( event ) if key == QC.Qt.Key_Escape: self.close() else: event.ignore()
def keyPressEvent(self, event): (modifier, key) = ClientGUIShortcuts.ConvertKeyEventToSimpleTuple(event) if key in (QC.Qt.Key_Enter, QC.Qt.Key_Return): self._DoOK() else: event.ignore()
def EventKeyDown( self, event ): ( modifier, key ) = ClientGUIShortcuts.ConvertKeyEventToSimpleTuple( event ) if key in ClientGUIShortcuts.DELETE_KEYS: self.ProcessDeleteAction() elif key in ( ord( 'A' ), ord( 'a' ) ) and modifier == QC.Qt.ControlModifier: self.selectAll() else: return True # was: event.ignore()
def keyPressEvent( self, event ): ( modifier, key ) = ClientGUIShortcuts.ConvertKeyEventToSimpleTuple( event ) current_focus = QW.QApplication.focusWidget() event_from_us = current_focus is not None and ClientGUIFunctions.IsQtAncestor( current_focus, self ) if event_from_us and key == QC.Qt.Key_Escape: self._TryEndModal( QW.QDialog.Rejected ) else: QP.Dialog.keyPressEvent( self, event )