[PyQt] quitting QApplication on end of state machine

emmanuel_mayssat at lynceantech.com emmanuel_mayssat at lynceantech.com
Mon May 9 23:07:26 BST 2011


Self corrected: 
Quotes were missing :-@

QObject.connect(machine, SIGNAL('finished()'), qApp, SLOT('quit()'))

--
E

On 11:44 Mon 09 May     , emmanuel_mayssat at lynceantech.com wrote:
> 
> 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
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 
Emmanuel


More information about the PyQt mailing list