Windows上的PyQt4应用程序在退出时崩溃 [英] PyQt4 application on Windows is crashing on exit
问题描述
我使用PyQt4编写了一个桌面应用程序,并且突然在退出时崩溃了。
I am writting a desktop application with PyQt4 and all of the sudden it started to crash on exit.
我检查了所有的代码,
I reviewed all of my code to make sure I wasn't doing anything funny to make it crash and I don't think there's anything wrong with the code.
我已经看到一些关于这个的投诉,但它是相关的一个以前的版本,人们建议升级到最新版本的PyQt4,所以我没有,但是没有帮助崩溃的问题。
I have seen some complaints about this before but it was related to a previous version and people advised to upgrade PyQt4 to the latest version and so I did, but that didn't help with the crashing problem.
所以我问,有什么这可以导致这种行为与PyQt4,我需要做一些终止过程清理Qt或任何我缺少的东西?
So I ask, is there anything that can lead to this behavior with PyQt4, do I need to do some kind on termination procedure to cleanup Qt or anything else I am missing?
推荐答案
我有一个简单的hello世界应用程序(QDialog与20标签)相同的问题。
I had the same problem with a simple hello world application (QDialog with 20 labels). Weirdly the problem disappears with 10 labels.
我通过强制退出解决如下:
I solved by forcing exit as follows:
def closeEvent(self, event):
exit()
在Windows上使用PyQt v4.10.3 for VirtualBox上的Python v2.7(x32)。
This happens on Windows with PyQt v4.10.3 for Python v2.7 (x32) on VirtualBox.
这篇关于Windows上的PyQt4应用程序在退出时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!