[PyQt] quitting QApplication on end of state machine

emmanuel_mayssat at lynceantech.com emmanuel_mayssat at lynceantech.com
Mon May 9 19:44:21 BST 2011


Hello,

I have the following code:

[...]
if __name__ == "__main__":
    import sys
    qApp = QApplication(sys.argv)
    #machine = StartupStateMachine()
    machine = QStateMachine()
    #QObject.connect(machine, SIGNAL('finished()'), QApplication.instance(), SLOT(quit()))
    QObject.connect(machine, SIGNAL('finished()'), qApp, SLOT(quit()))
    machine.start()
    #sys.exit(qApp.exec_())
    qApp.exec_()

when run the state machine is not even started and the qApp exits immediately.
what is happening?

PS: looked at code for meego... 
http://apidocs.meego.com/1.1/core/html/qt4/statemachine-api.html
I am using Qt4.6

-- 
Emmanuel


More information about the PyQt mailing list