Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2433

QCoreApplication will not quit

From Adrian Casey <mail@agcasey.com>
Newsgroups comp.lang.python
Subject QCoreApplication will not quit
Followup-To comp.lang.python
Message-ID <4Pxlp.301$CS3.118@viwinnwfe01.internal.bigpond.com> (permalink)
Date 2011-04-02 14:12 +0930
Organization BigPond

Followups directed to: comp.lang.python

Show all headers | View raw


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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

QCoreApplication will not quit Adrian Casey <mail@agcasey.com> - 2011-04-02 14:12 +0930
  Re: QCoreApplication will not quit Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-04-02 11:28 -0700
    Re: QCoreApplication will not quit Adrian Casey <mail@agcasey.com> - 2011-04-03 15:13 +0930

csiph-web