Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin3!goblin.stu.neva.ru!exi-transit.telstra.net!pit-in2.telstra.net!news.telstra.net!61.9.128.156.MISMATCH!viwinnwcl01.internal.bigpond.com!viwinnwfe01.internal.bigpond.com.POSTED!7564ea0f!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" From: Adrian Casey User-Agent: KNode/4.4.6 Content-Transfer-Encoding: 7Bit Newsgroups: comp.lang.python Subject: QCoreApplication will not quit Followup-To: comp.lang.python Lines: 28 MIME-Version: 1.0 Message-ID: <4Pxlp.301$CS3.118@viwinnwfe01.internal.bigpond.com> Date: Sat, 02 Apr 2011 14:12:38 +0930 NNTP-Posting-Host: 124.177.202.97 X-Complaints-To: abuse@bigpond.net.au X-Trace: viwinnwfe01.internal.bigpond.com 1301719360 124.177.202.97 (Sat, 02 Apr 2011 15:42:40 EST) NNTP-Posting-Date: Sat, 02 Apr 2011 15:42:40 EST Organization: BigPond Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2433 Can someone please explain why this simple PyQt4 application never exits? #!/usr/bin/env python from PyQt4 import QtCore import sys class foo(QtCore.QObject): def __init__(self, parent): QtCore.QObject.__init__(self, parent) self.parent = parent self.end_job() def end_job(self): QtCore.QCoreApplication.quit() if __name__ == '__main__': app = QtCore.QCoreApplication(sys.argv) myFoo = foo(parent=None) sys.exit(app.exec_()) This is just a very simple, cut-down example to demonstrate a problem I have with an application I am writing. If I call QCoreApplication.hasPendingEvents(), the result is always True. Even if I call QCoreApplication.processEvents(), the application still does not quit. It just hangs forever. I'd appreciate some help in finding out how to make it quit. Thanks. Adrian.