Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'sys': 0.04; '__name__': 0.07; 'python': 0.07; 'down,': 0.09; 'invokes': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'def': 0.13; "'__main__':": 0.16; 'bieber': 0.16; 'declaimed': 0.16; 'email addr:ix.netcom.com': 0.16; 'email name:wlfraed': 0.16; 'from:addr:ix.netcom.com': 0.16; 'from:addr:wlfraed': 0.16; 'from:name:dennis lee bieber': 0.16; 'received:66.245': 0.16; 'received:dsl.mindspring.com': 0.16; 'received:mindspring.com': 0.16; 'received:wlfraed': 0.16; 'url:netcom': 0.16; 'url:wlfraed': 0.16; 'wulfraed': 0.16; 'framework': 0.16; 'method.': 0.19; 'lee': 0.22; 'skip:# 10': 0.25; 'url:home': 0.25; 'sat,': 0.29; 'subject:not': 0.29; 'class': 0.29; 'invoke': 0.31; 'parent': 0.31; 'shut': 0.31; 'import': 0.32; 'to:addr:python-list': 0.32; 'someone': 0.33; 'header:X-Complaints-To:1': 0.34; 'starting': 0.34; 'charset:us-ascii': 0.36; 'it?': 0.37; 'apr': 0.38; 'received:org': 0.38; 'app': 0.39; 'explain': 0.39; 'to:addr:python.org': 0.39; 'could': 0.39; 'header:Mime- Version:1': 0.39; 'header:Received:5': 0.40; 'simple': 0.60; '2011': 0.62; 'ever': 0.65; 'dennis': 0.68; 'subject:will': 0.77; 'run?': 0.84; 'skip:q 30': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: QCoreApplication will not quit Date: Sat, 02 Apr 2011 11:28:24 -0700 Organization: > Bestiaria Support Staff < References: <4Pxlp.301$CS3.118@viwinnwfe01.internal.bigpond.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: user-11faegl.dsl.mindspring.com X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1301768912 news.xs4all.nl 81479 [::ffff:82.94.164.166]:51652 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2463 On Sat, 02 Apr 2011 14:12:38 +0930, Adrian Casey declaimed the following in gmane.comp.python.general: > 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_()) > Uhm... Could it be because you've shut down the application before ever starting it? Note that your __init__() method -- invoked when you create "myFoo", ENDS with a call to end_job() which invokes the framework quit() method. THEN after all this framework shut down, you invoke the app.exec_() on a framework that has nothing left to run? -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/