我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用PyQt5.QtWidgets.QApplication.quit()。
def enter(self): if self.note is None: msg = QMessageBox() message = "?????????????" msg = msg.information(self, 'info', message, QMessageBox.Ok, QMessageBox.Ok) if msg != QMessageBox.Ok: return self.key = self.key_default else: self.key = self.note[1] self.close() QApplication.quit()
def not_use_key(self): self.key = self.key_default self.close() QApplication.quit()
def not_use_key(self): self.key = "" self.close() QApplication.quit()
def finish(self): QApplication.quit()
def callback_exit(self): QApplication.quit()
def terminate(self): self.close() QApplication.quit()
def sigint_handler(*args): """Handler for the SIGINT signal.""" sys.stderr.write('\r') if QMessageBox.question(None, '', "Are you sure you want to quit?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.Yes: QApplication.quit()
def __init__(self, k_queue): super().__init__() self.S_SCREEN_NO = "0001" self.MARKET_LIST = { 0: '??', 3: 'ELW', 4: '?????', 5: '?????', 6: '??', 8: 'ETF', 9: '??????', 10: '???', 30: '?3??' } self.q = k_queue self.qs = { 'OnReceiveTrData': queue.Queue(), 'OnReceiveRealData': queue.Queue(), 'OnReceiveMsg': queue.Queue(), 'OnReceiveChejanData': queue.Queue(), 'OnEventConnect': queue.Queue(), 'OnReceiveRealCondition': queue.Queue(), 'OnReceiveTrCondition': queue.Queue(), 'OnReceiveConditionVer': queue.Queue() } self.ocx = QAxWidget("KHOPENAPI.KHOpenAPICtrl.1") self.ocx.OnReceiveTrData[str, str, str, str, str, int, str, str, str].connect(self.OnReceiveTrData) self.ocx.OnReceiveRealData[str, str, str].connect(self.OnReceiveRealData) self.ocx.OnReceiveMsg[str, str, str, str].connect(self.OnReceiveMsg) self.ocx.OnReceiveChejanData[str, int, str].connect(self.OnReceiveChejanData) self.ocx.OnEventConnect[int].connect(self.OnEventConnect) self.ocx.OnReceiveRealCondition[str, str, str, str].connect(self.OnReceiveRealCondition) self.ocx.OnReceiveTrCondition[str, str, str, int, int].connect(self.OnReceiveTrCondition) self.ocx.OnReceiveConditionVer[int, str].connect(self.OnReceiveConditionVer) atexit.register(self.quit) #################################################### # Interface Methods ####################################################
def quit(self): """ Quit the server """ self.disconnect_real_data(self.S_SCREEN_NO) QApplication.quit()