-
Qt app exit on h/w
Hi,
My S60/Qt app working properly but it is not exiting (always running in background) to stop this I need to reboot my h/w.
I tried flowing API to exit app
QApplication::quit (), QApplication::close ()
But both are not working.
If any body has any clues regarding this please share with me.
Thx
indvin
-
Re: Qt app exit on h/w
Hi,
Does the application have a UI? Have you tried simply pressing the red (hang-up call) button. Works every time for me!
What are you using to trigger the quit() and close() functions? Are you certain they are actually called?
Of course it's possible that your application hangs for some reason during exit - to help debug that we'd need more information.
Mark
-
Re: Qt app exit on h/w
Sorry to get back to this old thread but I didn't find the solution anywhere. I've exactly same problem with Qt 4.6.3 + Mobility 1.0.2 on all S60 devices.
Main funtion ends and I cannot see anything on app list but somehow the app stays alive. Data connection is still on and installer asks if want to close the app if try to install again.
-
Re: Qt app exit on h/w
Most likely the main window was closed but the application never ended. Simply closing the last window does not end the application -- it will continue merrily spinning/waiting in the event loop. Having a return follow the exec() is necessary but not sufficient -- you also have to execute the quit() slot (eg, as a result of pushing a button on your main screen).
And it's not that hard to fall into the trap of having exec() twice in your application, once in main.cpp and once in your main widget class. If you do that then the quit() will exit the first exec() but then you fall right into the second.
In any event, the red button should kill the app, unless it's caught in a tight run loop. (If that is the case you may not even be able to turn the phone off -- you may have to remove the battery.)
-
Re: Qt app exit on h/w
use QCoreApplication::quit(), I have used this in my program and it exits correctly and releases all the resources.
Else leave the default exit option on the rightselection soft key.
-
Re: Qt app exit on h/w