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;