本文整理汇总了Python中PyQt5.Qt.QCoreApplication.quit方法的典型用法代码示例。如果您正苦于以下问题:Python QCoreApplication.quit方法的具体用法?Python QCoreApplication.quit怎么用?Python QCoreApplication.quit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QCoreApplication
的用法示例。
在下文中一共展示了QCoreApplication.quit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_message_from_thread
# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import quit [as 别名]
def on_message_from_thread(self, msg):
if not msg or len(msg) < 2:
print("msg is empty!")
return
msg_name, msg_task_name = msg[:2]
if msg_name == 'ESCAPE_TIME':
self.escape_time = msg_task_name / 60
elif msg_name == 'HDF5_IMPORT':
if msg_task_name == 'INFO':
print(msg[2])
elif msg_task_name == 'THREAD':
status = msg[2]
if status == 'FAILURE':
self.details.append(msg[3])
self.hdf5_import_thread.terminate()
self.hdf5_import_thread = None
self.escape_time_thread.stop()
self.escape_time_thread = None
print("\n导入完毕, 共耗时 {:>.2f} 分钟".format(self.escape_time))
print('\n=========================================================')
print("导入详情:")
for info in self.details:
print(info)
print('=========================================================')
self.import_running = False
QCoreApplication.quit()
elif msg_task_name == 'IMPORT_KDATA':
ktype, progress = msg[2:4]
if ktype != 'FINISHED':
self.print_progress(ktype, progress)
else:
self.details.append('导入 {} {} 记录数:{}'.format(msg[3], msg[4], msg[5]))
elif msg_task_name == 'IMPORT_TRANS':
ktype, progress = msg[2:4]
if ktype != 'FINISHED':
self.print_progress('TRANS', progress)
else:
self.details.append('导入 {} 分笔记录数:{}'.format(msg[3], msg[5]))
elif msg_task_name == 'IMPORT_TIME':
ktype, progress = msg[2:4]
if ktype != 'FINISHED':
self.print_progress('TIME', progress)
else:
self.details.append('导入 {} 分时记录数:{}'.format(msg[3], msg[5]))
elif msg_task_name == 'IMPORT_WEIGHT':
if msg[2] == 'INFO':
pass
elif msg[2] == 'FINISHED':
print('导入权息数据完毕!')
elif msg[2] == '导入完成!':
self.details.append('导入权息记录数:{}'.format(msg[3]))
elif msg[2] == '权息数据无变化':
self.details.append(msg[3])
else:
print('权息{}'.format(msg[2]))