06-05-2014 04:33 AM
I'm using long-running headless app for some background stuff. At the same time at certain conditions I want to be able to ask headless part to quit when user closes UI.
Headless app is triggered using invocation framework. I've added Application::manualExit() signal handler (together with setAutoExit(false) which just sends special 'Quit' invocation to headless. And once finished calls Application::quit().
Unfortunately this way doesn't work. For some unknown reason I'm getting err=2 (BadRequest) with errorCode=4100. Headless part doesn't receive notification. If I change my app to call same code from other context (without using manualExit signal, for example by adding own 'exit' button to QML) everything works.
Any ideas? Is there any other way to make sure that headless app exits when UI is closed under certain conditions?
06-05-2014 06:22 AM
Don't know if it will works on headless app, but you can try it
06-05-2014 06:25 AM
thanks for your answer.
I'm not asking about 'how to detect when app closes'. The issue I've found is that once user tried to close app (by pressing 'X' button on app frame), invocation framework stops working...
06-05-2014 06:27 AM
06-05-2014 09:42 AM
It looks like it's even more tricky.
I've tried to reproduce it without headless stuff at all. Instead I'm trying to invoke standard browser.
It also works well if triggered by QML. But once I put same code to 'manualExit' handler it stops working. So this is some general issue with invocation framework.