Reply
Thread Tools
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#11
install event filter
__________________
Telegram | Openrepos | GitHub | Revolut donations
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#12
Originally Posted by xerxes2 View Post
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.
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.
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#13
Originally Posted by coderus View Post
install event filter
..to which event in which object? As i wrote in the original post, i already tried it with no success.
 
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#14
Originally Posted by vranki View Post
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.
Afaik you can only have one mainloop in both gtk and qt. I've never heard anything about having two.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#15
I think the reason for newly started main loop is in qwaylandeventthread.cpp line 37:

https://qt.gitorious.org/qt/qtwaylan...thread.cpp#L37

When app window is closed, the Wayland connection is broken and if something (in the new mainloop?) calls readWaylandEvents(), the process is killed.
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#16
okay, event filtering seems not to work in emulator, try:
Code:
  app->connect( app, SIGNAL(lastWindowClosed()), app, SLOT(quit()) );
  app->connect( app, SIGNAL(aboutToQuit()), app, SLOT(quit()) );
and why not to use main class destructor for this purpose?

and
Code:
    int retVal = app->exec();
    qDebug() << "App exiting with code:" << QString::number(retVal);
    //you can do whatever here
    return retVal;
__________________
Telegram | Openrepos | GitHub | Revolut donations
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#17
Originally Posted by coderus View Post
and why not to use main class destructor for this purpose?

Code:
    //you can do whatever here
Signals, slots, networking, and all other asynchronous stuff does not work without a event loop. And i need those.
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#18
what about other methods?
__________________
Telegram | Openrepos | GitHub | Revolut donations
 
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#19
Originally Posted by vranki View Post
Does not work - the main loop still exits. Same with Harmattan.
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
__________________
qgvdial: Google Voice client. All downloads
qgvtp: Phone integration for the n900 that dials out and sends texts using qgvdial.
mosquitto: message broker that implements the MQ Telemetry Transport protocol version 3.
qgvnotify: Google voice and contacts notifier for diablo and maemo.

If you want to thank me, click the Thanks button.
If you'd like to thank my applications, vote to move them to extras.
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#20
Originally Posted by uvatbc View Post
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
Ok, i think i'll need to create a simple test application for this issue.
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:13.