[SailfishDevel] How to handle app settings?

Thomas Tanghus thomas at tanghus.net
Sun Dec 29 22:16:03 UTC 2013


On Sunday 29 December 2013 21:48:18 Franck Routier wrote:
> Everything compiles fine, but on deployment, I get these messages:
> 
> [W] QCoreApplication::applicationDirPath:1906 -
> QCoreApplication::applicationDirPath: Please instantiate the
> QApplication object first

I use:

int main(int argc, char *argv[]) {
    QGuiApplication *app = SailfishApp::application(argc, argv);
    QQuickView *view = SailfishApp::createView();
    QmlSettings *settings = new QmlSettings();

    view->rootContext()->setContextProperty("settings", settings);
    view->setSource(SailfishApp::pathTo("qml/net.tanghus.currencyconverter.sailfish.qml"));
    view->showFullScreen();
    return app->exec();
}

This way you don't get the warning.

-- 
Best regards / Med venlig hilsen

Thomas Tanghus


More information about the Devel mailing list