Hello, I don't know what's the best way to do it, but here are some ideas.
1. Use aboutToQuit and block it with a QEventLoop ? It might not be enough and might leave the application cover open on the multitask grid, making it look not responding. 2. Launch a script / program when quitting, that performs the async task. Cheers, Lucien Le mercredi 11 décembre 2013 22:51:48 Ville Ranki a écrit : > Hello, > > I'm the author of Siilihai web forum reader <http://siilihai.com> and > i'm currently porting it to Sailfish. > > Siilihai needs to synchronize it's status (read messages etc) to a > remote server when user quits it. > > I have not found a way to do it in Sailfish. When user closes the > application, Sailfish terminates the Qt main loop which effectively > makes it impossible to do any asynchronous tasks. > > On desktop QApplication::setQuitOnLastWindowClosed(false) can be > used to instruct Qt to continue running main loop when last > window is closed, but it does not work on Sailfish. > > Restarting the main loop worked on Harmattan, but on Sailfish > it causes a crash inside Qt-Wayland code (qwaylandeventthread.cpp line > 37). I also tried to create a Qt event filter with no success. > > > Here is a example application to demonstrate the issue: > http://talk.maemo.org/attachment.php?attachmentid=33970&d=1386249527 > > This application creates a repeating timer which stops working > when the window is closed. > > I have already asked about the issue on TMO and #sailfishos, but didn't > get any satisfactory answers. > > http://talk.maemo.org/showthread.php?t=91947 > > The question is: is this a bug or intended behavior? Can anyone hack > the example application so that the timer keeps running after the window > is closed? > > -- > Ville Ranki <ville.ra...@iki.fi> > http://www.iki.fi/~cos > PGP public key: http://www.iki.fi/~cos/vranki_pub.asc > _______________________________________________ > SailfishOS.org Devel mailing list
_______________________________________________ SailfishOS.org Devel mailing list