PDA

View Full Version : PyQt: Closing GUI



Sailor5
February 25th, 2011, 05:21 PM
Greetings!

So currently when the GUI is exited the process carries on. To fix this all that needs to be done is when the GUI has been told to close we raise SystemExit. But how could I do this? Could someone give thee an example?

Thanks bye!

Chameco
February 25th, 2011, 07:55 PM
I don't have much experience, if at all, with QT, but if it's event based, you could connect a function like the following to the "quit" event, or something like it.


def onquit():
Insert whatever cleanup you need
sys.exit()