Exemplo n.º 1
0
int main(int argc, char **argv)
{
    QGuiApplication app (argc, argv);
    app.setOrganizationName("SfietKonstantin");
    app.setApplicationName("qfb-demo");

    Bridge bridge;

    QQuickView view;
    view.engine()->addImportPath(IMPORT_PATH);
    view.rootContext()->setContextProperty("BRIDGE", &bridge);
    view.setSource(QUrl(MAIN_QML_FILE));
    view.show();

    return app.exec();
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
    QGuiApplication *app = SailfishApp::application(argc, argv);

    app->setApplicationName("harbour-tinytodo");
    app->setApplicationVersion(QString(APP_VERSION)+QString(APP_VERSION_SUFFIX));
    qDebug()<<app->applicationName()<<" version "<<app->applicationVersion();

    QTranslator translator;
    //QString translationLocation = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
    QString translationLocation = "/usr/share/harbour-tinytodo/locale";
    QString translation = "harbour-tinytodo_" + QLocale::system().name();
    qDebug()<<"Translation location: "<<translationLocation;
    qDebug()<<"Translation: "<<translation;
    translator.load(translation, translationLocation);
    app->installTranslator(&translator);

    QQuickView *view = SailfishApp::createView();
    view->rootContext()->setContextProperty("appVersion", app->applicationVersion());
    view->setSource(SailfishApp::pathTo("qml/harbour-tinytodo.qml"));
    view->showFullScreen();

    return app->exec();
}