[PyQt] PyQT and twisted

Anita Diliberto ADiliberto at evertz.com
Tue Jun 19 20:33:48 BST 2007


I'm trying to use twisted and QT, but when I close down my application,
python continues to run.  This is the code I'm using below.  Any
suggestions?



--------------------------------------------------------------------------

from twisted.internet import reactor

app = QtGui.QApplication(sys.argv)
qt4reactor.install(app)

def main(args=None): 
    
    def quit():              
       reactor.stop() 
       app.quit()      
       sys.exit()

    reactor.addSystemEventTrigger('after', 'shutdown', app.quit)
    QtCore.QObject.connect(app, QtCore.SIGNAL("lastWindowClosed()"), quit)
    
    reactor.run()    


More information about the PyQt mailing list