Reply
Thread Tools
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#21
I attached a simple test application to this message. It creates a sailfish app and a timer printing a message every second. Before starting the app, it calls app->setQuitOnLastWindowClosed(false).

When you close the window, the mainloop exits and messages stop appearing.

Can anyone modify it so that after closing the window it still keeps running? Is current behavior a bug?
Attached Files
File Type: gz mainlooptest.tar.gz (9.8 KB, 166 views)
 
w00t's Avatar
Posts: 1,055 | Thanked: 4,107 times | Joined on Oct 2009 @ Norway
#22
This was a bug in the early SDK releases. Make sure you have the latest SDK.

See also: http://talk.maemo.org/showthread.php?t=91595

Note that I have no problems running this on device.
__________________
i'm a Qt expert and former Jolla sailor (forever sailing, in spirit).
if you like, read more about me.
if you find me entertaining, or useful, thank me. if you don't, then tell me why.
 

The Following 4 Users Say Thank You to w00t For This Useful Post:
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#23
Originally Posted by w00t View Post
This was a bug in the early SDK releases. Make sure you have the latest SDK.
Maintenance tool reports no updates available.

Originally Posted by w00t View Post
See also: http://talk.maemo.org/showthread.php?t=91595

Note that I have no problems running this on device.
Could you elaborate a little.. What exactly is printed to console when you close the app by swiping down? Does the process really stay running?
 
w00t's Avatar
Posts: 1,055 | Thanked: 4,107 times | Joined on Oct 2009 @ Norway
#24
Originally Posted by vranki View Post
Maintenance tool reports no updates available.
I don't know what to tell you, then. All I can say is that it's working fine, and I'm fairly sure we already fixed this

Originally Posted by vranki View Post
Could you elaborate a little.. What exactly is printed to console when you close the app by swiping down? Does the process really stay running?
The timer keeps running and printing. Yes.
__________________
i'm a Qt expert and former Jolla sailor (forever sailing, in spirit).
if you like, read more about me.
if you find me entertaining, or useful, thank me. if you don't, then tell me why.
 
Posts: 728 | Thanked: 1,217 times | Joined on Oct 2011
#25
Originally Posted by w00t View Post
I don't know what to tell you, then. All I can say is that it's working fine, and I'm fairly sure we already fixed this
Is there any way to tell for certain the version of the SDK, aside from Alpha? (perhaps a git revision or similar?)

Alternatively, I suggest resintalling the SDK :-D
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#26
Originally Posted by ggabriel View Post
Is there any way to tell for certain the version of the SDK, aside from Alpha? (perhaps a git revision or similar?)

Alternatively, I suggest resintalling the SDK :-D
I checked my SDK version (0.0.8-2) and Mer VM (2013.10.18-0) and they are the latest.


Can anyone give a third opinion how the app behaves on close?
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#27
I just tested in SDK with another PC and the application still behaves incorrectly:

Code:
Timer (and main loop) is still alive 
Timer (and main loop) is still alive 
Timer (and main loop) is still alive 
Timer (and main loop) is still alive 
Timer (and main loop) is still alive 
app->exec() exited - main loop stopped. This should NOT happen if user closed the window. But it does. 
Remote application finished with exit code 0.
 
Posts: 50 | Thanked: 100 times | Joined on Jan 2012 @ Tampere, Finland
#28
The issue is now resolved. The bug was in still in latest SDK and was recently fixed by a SDK update. It also works correctly on device. Thanks for help!
 
Posts: 3,464 | Thanked: 5,107 times | Joined on Feb 2010 @ Gothenburg in Sweden
#29
No I am really confused.

Because in my case my app dont leave mainloop and in my case I want it to leave


Code:
 
    QGuiApplication *app = SailfishApp::application(argc, argv);
    app->setQuitOnLastWindowClosed(true);
    UDPManager *udp = new UDPManager();
    QQuickView *view = SailfishApp::createView();
    QObject::connect(app, SIGNAL(lastWindowClosed()), app, SLOT(quit()));
    view->rootContext()->setContextProperty("version", QString(VERSION));
    view->rootContext()->setContextProperty("udp", udp);
    view->setSource(QString("/usr/share/harbour-push2sail/qml/push2sail.qml"));
    view->showFullScreen();
    res = app->exec(); // stays here even when user swipe down and window closes 
    delete app;
    delete udp;
    return res;
__________________
Keep safe and healthy

Last edited by mikecomputing; 2013-12-22 at 17:01.
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#30
maybe just emulator bug. test on device and ignore emulator bug if arm build works okay
__________________
Telegram | Openrepos | GitHub | Revolut donations
 
Reply

Thread Tools

 
Forum Jump


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