|
2013-12-04
, 20:10
|
Posts: 50 |
Thanked: 100 times |
Joined on Jan 2012
@ Tampere, Finland
|
#12
|
Why are you calling eventLoop.exec()? You already has one mainloop running so just put your cleanup code in the aboutToQuit callback instead. The mainloop will not exit before the aboutToQuit callback returns. There was a bug in earlier sdk but in the latest version it works just fine.
|
2013-12-04
, 20:13
|
Posts: 50 |
Thanked: 100 times |
Joined on Jan 2012
@ Tampere, Finland
|
#13
|
|
2013-12-04
, 20:26
|
|
Posts: 513 |
Thanked: 651 times |
Joined on Feb 2011
@ Sweden
|
#14
|
The app is single threaded - everything happens in the main event loop. Everything (signals, slots, timers, networking) is frozen during aboutToQuit() call. That's why i'd need a second event loop to do processing without exiting aboutToQuit() in main thread.
|
2013-12-04
, 20:35
|
Posts: 50 |
Thanked: 100 times |
Joined on Jan 2012
@ Tampere, Finland
|
#15
|
|
2013-12-04
, 20:59
|
|
Posts: 6,436 |
Thanked: 12,699 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#16
|
app->connect( app, SIGNAL(lastWindowClosed()), app, SLOT(quit()) ); app->connect( app, SIGNAL(aboutToQuit()), app, SLOT(quit()) );
int retVal = app->exec(); qDebug() << "App exiting with code:" << QString::number(retVal); //you can do whatever here return retVal;
|
2013-12-04
, 21:28
|
Posts: 50 |
Thanked: 100 times |
Joined on Jan 2012
@ Tampere, Finland
|
#17
|
|
2013-12-04
, 21:32
|
|
Posts: 6,436 |
Thanked: 12,699 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#18
|
|
2013-12-05
, 00:04
|
Posts: 1,048 |
Thanked: 979 times |
Joined on Mar 2008
@ SF Bay Area
|
#19
|
|
2013-12-05
, 12:19
|
Posts: 50 |
Thanked: 100 times |
Joined on Jan 2012
@ Tampere, Finland
|
#20
|
Well thats surprising - I've been using setQuitOnLastWindowClosed in Maemo, Harmattan, Windows and desktop Linux at least for the last two years in qgvdial to achieve exactly what you need: Running the application in the background.
https://code.google.com/p/qgvdial/so...k/src/main.cpp
Telegram | Openrepos | GitHub | Revolut donations