1
justou 2016-10-08 08:57:56 +08:00
做一些会卡界面的操作放到单独线程更好, 比如在界面显示的同时要加载大量初始化数据,把加载数据的工作放在单独线程, 不阻塞界面的显示, 但是最好给出一个模态窗口提示数据正在加载,让用户稍等;
或者在主界面显示之前用闪屏提示数据正在加载,有 photoshop 的话打开看看它的界面显示过程 |
2
wangxkww 2016-10-08 14:07:24 +08:00
sys.exit 报什么错误呢?
|
3
zhuangzhuang1988 2016-10-08 16:04:24 +08:00
不可能...
|
4
4ever911 OP @zhuangzhuang1988
Please see code below: ```python from PyQt4 import QtGui, QtCore import sys import time app = QtGui.QApplication(sys.argv) #the following line will crash the app time.sleep(300) w = QtGui.QDialog() w.show() sys.exit(app.exec_()) ```python Error Message: ICE default IO error handler doing an exit(), pid = 31805, errno = 32 In some certain occasion, when tasks that take so much time for running, such as loading a database...etc, the app crashes either. To make it simple here, I just added a short period of time sleep to the source code, which crashes the app. Sorry about that I cannot type Chinese on my Linux Server. |