Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Closing an application without killing main loop

    Reply
    Page 3 of 3 | Prev |   1     2   3 |
    vranki | # 21 | 2013-12-05, 13:23 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: gz mainlooptest.tar.gz (9.8 KB, 174 views)

     
    w00t | # 22 | 2013-12-05, 13:48 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 4 Users Say Thank You to w00t For This Useful Post:
    ggabriel, miqu, OVK, szopin

     
    vranki | # 23 | 2013-12-05, 14:00 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    w00t | # 24 | 2013-12-05, 14:18 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    ggabriel | # 25 | 2013-12-05, 15:20 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    vranki | # 26 | 2013-12-06, 11:01 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    vranki | # 27 | 2013-12-06, 13:18 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    vranki | # 28 | 2013-12-18, 15:54 | Report

    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!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mikecomputing | # 29 | 2013-12-22, 16:58 | Report

    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;

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by mikecomputing; 2013-12-22 at 17:01.

     
    coderus | # 30 | 2013-12-22, 18:23 | Report

    maybe just emulator bug. test on device and ignore emulator bug if arm build works okay

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 3 of 3 | Prev |   1     2   3 |
vBulletin® Version 3.8.8
Normal Logout