示例#1
0
int main(int argc, char *argv[]) {
    QGuiApplication* app = SailfishApp::application(argc, argv);
    QQuickView* view = SailfishApp::createView();

    Configurator config;
    config.load();

    //qmlRegisterType<Request>("Sailbook.Request", 1, 0, "Request");
    qmlRegisterUncreatableType<Request>("App.Sailbook", 1, 0, "Request", QStringLiteral("Error"));
    //qmlRegisterInterface<SessionManager>("SessionManager");

    SessionManager session(QStringLiteral(APPID), config.getValue(QStringLiteral("token")).toString());
    session.setExtendedPermission(SessionManager::ExtendedPermissions(
        SessionManager::Email |
        SessionManager::ManageNotifications |
        SessionManager::ManagePages |
        SessionManager::PublishActions |
        SessionManager::ReadFriendList |
        SessionManager::ReadInsights |
        SessionManager::ReadMailbox |
        SessionManager::ReadPageMailboxes |
        SessionManager::ReadStream |
        SessionManager::RsvpEvent
    ));

    session.setUserDataPermission(SessionManager::UserDataPermissions(
        SessionManager::UserAboutMe |
        SessionManager::UserActionsBooks |
        SessionManager::UserActionsMusic |
        SessionManager::UserActionsNews |
        SessionManager::UserActionsVideo |
        SessionManager::UserActivities |
        SessionManager::UserBirthday |
        SessionManager::UserEducationHistory |
        SessionManager::UserEvents |
        SessionManager::UserFriends |
        SessionManager::UserGamesActivity |
        SessionManager::UserGroups |
        SessionManager::UserHometown |
        SessionManager::UserInterests |
        SessionManager::UserLikes |
        SessionManager::UserLocation |
        SessionManager::UserPhotos |
        SessionManager::UserRelationshipDetails |
        SessionManager::UserRelationships |
        SessionManager::UserReligionPolitics |
        SessionManager::UserStatus |
        SessionManager::UserTaggedPlaces |
        SessionManager::UserVideos |
        SessionManager::UserWebsite |
        SessionManager::UserWorkHistory
    ));

    view->rootContext()->setContextProperty("SessionManager", &session);
    view->rootContext()->setContextProperty("Configurator", &config);
    view->setSource(SailfishApp::pathTo("qml/sailbook.qml"));
    view->show();

    return app->exec();
}
int main(int argc, char *argv[])
{
    // SailfishApp::main() will display "qml/template.qml", if you need more
    // control over initialization, you can use:
    //
    //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
    //   - SailfishApp::createView() to get a new QQuickView * instance
    //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
    //
    // To display the view, call "show()" (will show fullscreen on device).
    QCoreApplication::setOrganizationName("org");
    QCoreApplication::setOrganizationDomain("Sparkeyy");
    QCoreApplication::setApplicationName("harbour-spritradar");
    qmlRegisterType<Settings>("harbour.spritradar.Settings", 1,0, "Settings");

    QGuiApplication* app = SailfishApp::application(argc, argv);

    QQuickView* view = SailfishApp::createView();
    QObject::connect(view->engine(), SIGNAL(quit()), app, SLOT(quit()));
    view->rootContext()->setContextProperty("tankerkoenig_apikey", TANKERKOENIG_APIKEY); //Claim here: https://creativecommons.tankerkoenig.de/#register
    // has to be set as additional qmake argument to the project configuration (armv7hl, i486 and debug/release for both), like this: "TANKERKOENIG_APIKEY=<your_apikey>"
    view->setSource(SailfishApp::pathTo("qml/harbour-spritradar.qml"));
    view->show();

    return app->exec();
}
示例#3
0
Q_DECL_EXPORT int main(int argc, char *argv[]) {
	QGuiApplication *lApplication = new QGuiApplication(argc, argv);
	QQuickView *lView = new QQuickView;
	lView->setResizeMode(QQuickView::SizeRootObjectToView);

	QVariantList lLevelList;
	createAllLevels(lLevelList);
	lView->rootContext()->setContextProperty(QStringLiteral("gLevels"), lLevelList);

	QNetworkAccessManager lNetworkManager;
	LevelModel *lLevelModel = new LevelModel(lLevelList.count(), &lNetworkManager, lApplication);
	lView->rootContext()->setContextProperty(QStringLiteral("gLevelModel"), lLevelModel);

	HighScoresModel *lHighScoresModel = new HighScoresModel(lApplication);
	lView->rootContext()->setContextProperty(QStringLiteral("gHighScoresModel"), lHighScoresModel);

	QObject::connect(lLevelModel, SIGNAL(postingSucceded()), lHighScoresModel, SLOT(readScoresFromFile()));
	QObject::connect(lView->engine(), SIGNAL(quit()), lApplication, SLOT(quit()));

	qmlRegisterType<LevelHighScoresModel>("ChimpModels", 1, 0, "LevelHighScoreModel");
	LevelHighScoresModel::registerOtherModels(lLevelModel, lHighScoresModel);

	lView->setSource(QStringLiteral("qrc:///qml/Game.qml"));
	lView->showFullScreen();

	return lApplication->exec();
}
示例#4
0
int main(int argc, char *argv[])
{
    // SailfishApp::main() will display "qml/template.qml", if you need more
    // control over initialization, you can use:
    //
    //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
    //   - SailfishApp::createView() to get a new QQuickView * instance
    //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
    //
    // To display the view, call "show()" (will show fullscreen on device).

    QGuiApplication *app = SailfishApp::application(argc, argv);

    QTranslator translator;
    translator.load(QLocale::system(), "ownNotes", "_", SailfishApp::pathTo("i18n").toLocalFile(), ".qm");
    app->installTranslator(&translator);
    QPython::registerQML();
    qmlRegisterType<DocumentHandler>("net.khertan.documenthandler", 1, 0, "DocumentHandler");
    QQuickView *view = SailfishApp::createView();
    view->setSource(SailfishApp::pathTo("qml/ownNotes.qml"));
    view->engine()->rootContext()->setContextProperty("VERSION", VERSION);
    view->show();

    return app->exec();
}
示例#5
0
文件: main.cpp 项目: Matoking/Filetug
int main(int argc, char *argv[])
{
    // SailfishApp::main() will display "qml/template.qml", if you need more
    // control over initialization, you can use:
    //
    //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
    //   - SailfishApp::createView() to get a new QQuickView * instance
    //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
    //
    // To display the view, call "show()" (will show fullscreen on device).

    qRegisterMetaType<QList<FileInfoEntry*> >();

    QGuiApplication *app = SailfishApp::application(argc, argv);
    QQuickView *view = SailfishApp::createView();

    // Add image providers and C++ classes
    view->engine()->addImageProvider(QLatin1String("thumbnail"), new ThumbnailProvider);

    FileEngine fileEngine;
    view->engine()->rootContext()->setContextProperty("engine", &fileEngine);
    view->engine()->rootContext()->setContextProperty("fileList", fileEngine.fileList);
    view->engine()->rootContext()->setContextProperty("fileInfo", fileEngine.fileInfo);
    view->engine()->rootContext()->setContextProperty("fileProcess", fileEngine.fileProcess);
    view->engine()->rootContext()->setContextProperty("clipboard", fileEngine.clipboard);
    view->engine()->rootContext()->setContextProperty("settings", fileEngine.settings);
    view->engine()->rootContext()->setContextProperty("coverModel", fileEngine.coverModel);

    // Show the application
    view->setSource(SailfishApp::pathTo("qml/Filetug.qml"));
    view->show();

    return app->exec();
}
void DisplayManagerRPI::resetRendering()
{
  QGuiApplication *guiApp = (QGuiApplication*)QGuiApplication::instance();
  QQuickWindow *window = (QQuickWindow*)guiApp->focusWindow();
  if (window)
  {
    QLOG_INFO() << "Recreating Qt UI renderer";

    // destroy the window to reset  OpenGL context
    window->setPersistentOpenGLContext(false);
    window->setPersistentSceneGraph(false);
    window->destroy();

    // Grab the Platform integration private object and recreate it
    // this allows to clean / recreate the dispmanx objects
    QGuiApplicationPrivate *privateApp = (QGuiApplicationPrivate *)QGuiApplicationPrivate::get(guiApp);
    QPlatformIntegration *integration = privateApp->platformIntegration();

    if (integration)
    {
      integration->destroy();
      QThread::msleep(500);
      integration->initialize();
    }
    else
    {
      QLOG_ERROR() << "Failed to retrieve platform integration";
    }

    // now recreate the window OpenGL context
    window->setScreen(QGuiApplication::primaryScreen());
    window->create();
  }
}
void QEGLDeviceIntegration::screenDestroy()
{
    QGuiApplication *app = qGuiApp;
    QEglFSIntegration *platformIntegration = static_cast<QEglFSIntegration *>(
        QGuiApplicationPrivate::platformIntegration());
    while (!app->screens().isEmpty())
        platformIntegration->removeScreen(app->screens().last()->handle());
}
示例#8
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QGuiApplication* app = SailfishApp::application(argc, argv);

    qmlRegisterType<Creature>("harbour.morzyn", 1,0 , "Creature");
    qmlRegisterType<Player>("harbour.morzyn", 1,0 , "Player");
    qmlRegisterType<Game>("harbour.morzyn", 1,0 , "Game");
    qmlRegisterType<Scroll>("harbour.morzyn", 1,0 , "Scroll");
    qmlRegisterType<Statistics>("harbour.morzyn", 1,0 , "Statistics");
    qmlRegisterType<Library>("harbour.morzyn", 1,0 , "Library");

    QSettings settings(QSettings::IniFormat, QSettings::UserScope, "harbour-morzyn", "morzyn");
    if (!settings.contains("fullscreen"))
        settings.setValue("fullscreen", QVariant((bool)true));
    if (!settings.contains("music"))
        settings.setValue("music", QVariant((bool)true));
    if (!settings.contains("sound"))
        settings.setValue("sound", QVariant((bool)true));


    qsrand ( time(NULL) );

    QString locale = QLocale::system().name();

    QTranslator translator;
    translator.load(QString("morzyn_") + locale.left(2).toLower(), SailfishApp::pathTo("translations").toString());
    app->installTranslator(&translator);

    GameService gs;
    Game g;
    Constants c;
    c.HCOUNT = 10;
    c.VCOUNT = 10;
    Library library;
    Statistics s;

    gs.setGame(&g);
    gs.setConstants(&c);
    gs.setLibrary(&library);
    gs.setStatistics(&s);
    gs.setSettings(&settings);

    QQuickView* view = SailfishApp::createView();
    view->rootContext()->setContextProperty("gameService", &gs);
    view->rootContext()->setContextProperty("game", &g);
    view->rootContext()->setContextProperty("library", &library);
    view->rootContext()->setContextProperty("statistics", &s);
    view->rootContext()->setContextProperty("os", QVariant("sailfish"));
    view->rootContext()->setContextProperty("hCount", QVariant(c.HCOUNT));
    view->rootContext()->setContextProperty("vCount", QVariant(c.VCOUNT));
    view->rootContext()->setContextProperty("version", QVariant("0.7.17"));
    view->setTitle("Morzyn v0.7.17");
    view->setSource(SailfishApp::pathTo("qml/morzyn.qml"));
    view->show();
    
    return app->exec();
}
示例#9
0
/**
 * TODO: get log level from cmake file
 */
int main ( int argc, char *argv[] ) {
    QGuiApplication app ( argc, argv );

    QQmlApplicationEngine engine;
    qmlRegisterSingletonType<QtConverter> ( "jogesayu", 1, 0, "Converter", converter_qml_singleton_provider );
    engine.load ( QUrl ( QStringLiteral ( "qrc:///main.qml" ) ) );

    return app.exec();
}
示例#10
0
int main(int argc, char *argv[])
{
    // QLoggingCategory::setFilterRules(QLatin1String("*.debug=false"));

    qmlRegisterUncreatableType<qml::DataRepositoryObject>("harbour.twablet", 1, 0, "DataRepository", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::IModel>("harbour.twablet", 1, 0, "Model", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::AccountObject>("harbour.twablet", 1, 0, "Account", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::LayoutObject>("harbour.twablet", 1, 0, "Layout", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::QueryTypeObject>("harbour.twablet", 1, 0, "QueryType", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::TweetObject>("harbour.twablet", 1, 0, "Tweet", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::QuotedTweetObject>("harbour.twablet", 1, 0, "QuotedTweet", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::UserObject>("harbour.twablet", 1, 0, "User", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::MediaObject>("harbour.twablet", 1, 0, "Media", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::MediaModel>("harbour.twablet", 1, 0, "MediaModel", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<qml::IQueryItem>("harbour.twablet", 1, 0, "QueryItem", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<Info>("harbour.twablet", 1, 0, "Info", QLatin1String("Uncreatable"));
    qmlRegisterType<qml::TwitterAuthentification>("harbour.twablet", 1, 0, "TwitterAuthentification");
    qmlRegisterType<qml::AccountModel>("harbour.twablet", 1, 0, "AccountModel");
    qmlRegisterType<qml::AccountSelectionModel>("harbour.twablet", 1, 0, "AccountSelectionModel");
    qmlRegisterType<qml::LayoutModel>("harbour.twablet", 1, 0, "LayoutModel");
    qmlRegisterType<qml::TweetModel>("harbour.twablet", 1, 0, "TweetModel");
    qmlRegisterType<qml::QueryTypeModel>("harbour.twablet", 1, 0, "QueryTypeModel");
    qmlRegisterType<qml::DescriptionFormatter>("harbour.twablet", 1, 0, "DescriptionFormatter");
    qmlRegisterType<qml::TweetFormatter>("harbour.twablet", 1, 0, "TweetFormatter");
    qmlRegisterType<qml::QuotedTweetFormatter>("harbour.twablet", 1, 0, "QuotedTweetFormatter");
    qmlRegisterType<qml::UserModel>("harbour.twablet", 1, 0, "UserModel");
    qmlRegisterType<qml::TweetQueryItem>("harbour.twablet", 1, 0, "TweetQueryItem");
    qmlRegisterType<qml::UserQueryItem>("harbour.twablet", 1, 0, "UserQueryItem");
    qmlRegisterType<qml::TweetListQueryWrapperObject>("harbour.twablet", 1, 0, "TweetListQuery");
    qmlRegisterType<qml::UserListQueryWrapperObject>("harbour.twablet", 1, 0, "UserListQuery");
    qmlRegisterType<qml::StatusUpdateQueryWrapperObject>("harbour.twablet", 1, 0, "StatusUpdateQuery");
    qmlRegisterType<qml::TweetSpecificQueryWrapperObject>("harbour.twablet", 1, 0, "TweetQuery");
    qmlRegisterType<qml::UserSpecificQueryWrapperObject>("harbour.twablet", 1, 0, "UserQuery");
    qmlRegisterSingletonType<qml::DataRepositoryObject>("harbour.twablet", 1, 0, "Repository",
                                                          [](QQmlEngine *e, QJSEngine *) -> QObject * {
        return new qml::DataRepositoryObject(e);
    });
    qmlRegisterSingletonType<Info>("harbour.twablet", 1, 0, "INFO",
                                   [](QQmlEngine *e, QJSEngine *) -> QObject * {
        return new Info(e);
    });
    qmlRegisterSingletonType<NetworkMonitor>("harbour.twablet", 1, 0, "NetworkMonitor",
                                             [](QQmlEngine *e, QJSEngine *) -> QObject * {
        return new NetworkMonitor(e);
    });

#ifndef DESKTOP
    return SailfishApp::main(argc, argv);
#else
    QGuiApplication app {argc, argv};
    QQuickView view {};
    view.setSource(QUrl(QLatin1String("qrc:/qml/harbour-twablet.qml")));
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    view.show();
    return app.exec();
#endif
}
示例#11
0
文件: main.cpp 项目: CODeRUS/gist
int main(int argc, char *argv[])
{
    QGuiApplication *app = new QGuiApplication(argc, argv);

    Gist *gist = new Gist(app);
    QTimer::singleShot(1, gist, SLOT(start()));

    return app->exec();
}
示例#12
0
QCoreApplication *
createAppObject(int &argc, char **argv)
{
    //qputenv("QT_QUICK_CONTROLS_STYLE", "Base");
    QGuiApplication *app = new QGuiApplication(argc, argv);

    // This doesn't seem to work...
    app->setQuitOnLastWindowClosed(false);
    return app;
}//createAppObject
示例#13
0
int main (int argc, char ** argv) {
	QGuiApplication app (argc, argv);

	GlWindow window (QSize (480, 480)); // Here is the size of the jacobi map (doesn't change with the window size)
	window.resize (480, 480);
	window.show ();

	window.setAnimating (true);

	return app.exec ();
}
示例#14
0
int main(int argc, char *argv[])
{
     QGuiApplication *app = SailfishApp::application(argc, argv);
     QString locale = QLocale::system().name();
     QTranslator translator;
     translator.load(locale,SailfishApp::pathTo(QString("localization")).toLocalFile());
     app->installTranslator(&translator);
     QQuickView *view = SailfishApp::createView();
     view->setSource(SailfishApp::pathTo("qml/main.qml"));
     view->showFullScreen();
     return app->exec();
}
示例#15
0
int main(int argc, char *argv[]) {
	if (argc < 2)
		return -1;
//	QCoreApplication::setAttribute(Qt::AA_X11InitThreads);
//	QApplication app(argc, argv);
//    QGuiApplication *app = SailfishApp::application(argc, argv);
//    QQuickView *view = SailfishApp::createView();
    QGuiApplication *app = new QGuiApplication(argc, argv);
    QQuickView *view = new QQuickView();

	EmuView emuView(&snesEmu, argv[1], view);
	return app->exec();
}
int main(int argc, char *argv[])
{
    QProcess appinfo;
    QString appversion;
    QString appname = "TaskList";
    QString pkgname = "harbour-tasklist";

    QCoreApplication::setOrganizationName(pkgname);
    QCoreApplication::setApplicationName(pkgname);

    // read app version from rpm database on startup
    appinfo.start("/bin/rpm", QStringList() << "-qa" << "--queryformat" << "%{version}" << pkgname);
    appinfo.waitForFinished(-1);
    if (appinfo.bytesAvailable() > 0) {
        appversion = appinfo.readAll();
    }

    /*  Internationalization Support
        thanks to Antoine Reversat who mentioned this here:
        https://www.mail-archive.com/[email protected]/msg02602.html */
    QGuiApplication* app = SailfishApp::application(argc, argv);

    // load default translator and system locale's translator afterwards
    QTranslator defaultTranslator;
    defaultTranslator.load("en_US", SailfishApp::pathTo(QString("localization")).toLocalFile());
    app->installTranslator(&defaultTranslator);

    QSettings settings;
    QString locale = settings.value("language", "").toString();
    if (locale.isEmpty() || locale == QString("system_default")) {
        /* use system locale by default */
        if (locale.isEmpty())
            settings.setValue("language", "system_default");
        locale = QLocale::system().name();
    }

    QTranslator translator;
    translator.load(locale, SailfishApp::pathTo(QString("localization")).toLocalFile());
    app->installTranslator(&translator);

    qmlRegisterType<TasksExport>("harbour.tasklist.tasks_export", 1, 0, "TasksExport");

    QQuickView* view = SailfishApp::createView();
    QObject::connect(view->engine(), SIGNAL(quit()), app, SLOT(quit()));
    view->rootContext()->setContextProperty("version", appversion);
    view->rootContext()->setContextProperty("appname", appname);
    view->setSource(SailfishApp::pathTo("qml/harbour-tasklist.qml"));
    view->show();

    return app->exec();
}
示例#17
0
int main(int argc, char *argv[])
{
    int result = 0;

    QGuiApplication *app = SailfishApp::application(argc, argv);
    QQuickView *view = SailfishApp::createView();

    qmlRegisterType<PlotWidget>("harbour.messwerk.MesswerkWidgets", 1, 0, "PlotWidget");
    qmlRegisterType<SatellitePosWidget>("harbour.messwerk.MesswerkWidgets", 1, 0, "SatellitePosWidget");
    qmlRegisterType<SatelliteStrengthWidget>("harbour.messwerk.MesswerkWidgets", 1, 0, "SatelliteStrengthWidget");

    QTimer refreshTimer;

    Accelerometer accelerometer(false);
    Gyroscope gyroscope(false);
    Magnetometer magnetometer(false);
    Rotation rotation(false);
    Light light(false);
    Proximity proximity(true);
    SatelliteInfo satelliteinfo;
    Position position;

    // connect not self-refreshing sensors to the global timer
    QObject::connect(&refreshTimer, SIGNAL(timeout()), &accelerometer, SLOT(refresh()));
    QObject::connect(&refreshTimer, SIGNAL(timeout()), &gyroscope, SLOT(refresh()));
    QObject::connect(&refreshTimer, SIGNAL(timeout()), &magnetometer, SLOT(refresh()));
    QObject::connect(&refreshTimer, SIGNAL(timeout()), &rotation, SLOT(refresh()));
    QObject::connect(&refreshTimer, SIGNAL(timeout()), &light, SLOT(refresh()));

    QString qml = QString("qml/%1.qml").arg("Messwerk");
    view->rootContext()->setContextProperty("accelerometer", &accelerometer);
    view->rootContext()->setContextProperty("gyroscope", &gyroscope);
    view->rootContext()->setContextProperty("magnetometer", &magnetometer);
    view->rootContext()->setContextProperty("rotationsensor", &rotation);
    view->rootContext()->setContextProperty("lightsensor", &light);
    view->rootContext()->setContextProperty("proximitysensor", &proximity);
    view->rootContext()->setContextProperty("satelliteinfo", &satelliteinfo);
    view->rootContext()->setContextProperty("positionsensor", &position);
    view->rootContext()->setContextProperty("settings", &(Settings::instance()));
    view->setSource(SailfishApp::pathTo(qml));
    view->show();

    refreshTimer.start(100);

    result = app->exec();

    delete view;
    delete app;

    return result;
}
示例#18
0
int main(int argc, char *argv[])
{
    QGuiApplication *app = SailfishApp::application(argc, argv);
    QQuickView *view = SailfishApp::createView();
    QQmlContext *context = view->rootContext();

    // This will hook into the view and render OpenGL on top of it
    ShaderToyGLView shaderToyView(view);
    context->setContextProperty("shaderToy", &shaderToyView);
    view->setSource(SailfishApp::pathTo("qml/shadertoy.qml"));
    view->show();

    return app->exec();
}
示例#19
0
int
main(int argc, char *argv[])
{
    QGuiApplication *app = SailfishApp::application(argc, argv);

    qInstallMessageHandler(myQt5MessageOutput);

    MainWindow *win = new MainWindow(app);
    Q_UNUSED(win);

    int rv = app->exec();
    delete win;
    return rv;
}
示例#20
0
int main(int argc, char *argv[])
{
    QGuiApplication *app = new QGuiApplication(argc, argv);
    QQuickView *view = new QQuickView;

    qmlRegisterSingletonType<Mpris>("org.nemomobile.qtmpris", 1, 0, "Mpris", Mpris::api_factory);
    qmlRegisterType<MprisPlayer>("org.nemomobile.qtmpris", 1, 0, "MprisPlayer");

    view->setSource(app->applicationDirPath().append("/../qml/player.qml"));
    view->show();

    int retVal = app->exec();

    return retVal;
}
示例#21
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();
}
int main(int argc, char *argv[])
{
    QGuiApplication* app = SailfishApp::application(argc, argv);

    QQuickView* view = SailfishApp::createView();
    Settings* settings = new Settings("harbour-badvoltage", "BadVoltage");
    FileDownloader* downloader = new FileDownloader(settings);
    QObject::connect(app, SIGNAL(aboutToQuit()), downloader, SLOT(doEnd()));
    QObject::connect(app, SIGNAL(aboutToQuit()), settings, SLOT(sync()));

    view->rootContext()->setContextProperty("settings", settings);
    view->rootContext()->setContextProperty("downloader", downloader);
    view->setSource(SailfishApp::pathTo("qml/harbour-badvoltage.qml"));
    view->show();

    return app->exec();
}
示例#23
0
int main(int argc, char *argv[])
{
    Q_INIT_RESOURCE(preload);
    QGuiApplication app (argc, argv);

    if (app.arguments().count() != 2) {
        return 10;
    }

    QmlModule::registerTypes();
    QString source = app.arguments().at(1);

    QmlRuntime::Ptr runtime (QmlRuntimeFactory::create());
    bool preloaded = runtime->preload(QUrl(QLatin1String("qrc:/preload.qml")));
    Q_ASSERT(preloaded);
    Q_UNUSED(preloaded);
    runtime->execute(QUrl(source));
    return app.exec();
}
int main(int argc, char *argv[])
{
     QGuiApplication *app = SailfishApp::application(argc, argv);
     QQuickView *view = SailfishApp::createView();
     Settings *settings = new Settings();
    // SailfishApp::main() will display "qml/template.qml", if you need more
    // control over initialization, you can use:
    //
    //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
    //   - SailfishApp::createView() to get a new QQuickView * instance
    //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
    //
    // To display the view, call "show()" (will show fullscreen on device).

     view->rootContext()->setContextProperty("settings", settings);
     view->setSource(SailfishApp::pathTo("qml/harbour-scocadigo.qml"));
     view->showFullScreen();
 return app->exec();
}
int main(int argc, char *argv[])
{
    // SailfishApp::main() will display "qml/template.qml", if you need more
    // control over initialization, you can use:
    //
    //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
    //   - SailfishApp::createView() to get a new QQuickView * instance
    //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
    //
    // To display the view, call "show()" (will show fullscreen on device).
    QGuiApplication* app = SailfishApp::application(argc, argv);
    QQuickView* view = SailfishApp::createView();
    view->setSource(SailfishApp::pathTo("qml/harbour-littlerace.qml"));
    view->show();
    QObject::connect((QObject*)view->engine(), SIGNAL(quit()), app, SLOT(quit()));

    return app->exec();
   //return SailfishApp::main(argc, argv);
}
示例#26
0
int main(int argc, char *argv[])
{
    QGuiApplication *app = SailfishApp::application(argc, argv);
    QQuickView *view = SailfishApp::createView();

    QCoreApplication::setOrganizationName("ruedigergad.com");
    QCoreApplication::setOrganizationDomain("ruedigergad.com");
    QCoreApplication::setApplicationName("SkippingStones");

    qmlRegisterType<BtConnector>("harbour.skippingstones", 1, 0, "BtConnector");
    qmlRegisterType<BtMessage>("harbour.skippingstones", 1, 0, "BtMessage");
    qmlRegisterType<DbusAdapter>("harbour.skippingstones", 1, 0, "DbusAdapter");
    qmlRegisterType<FileSystemHelper>("harbour.skippingstones", 1, 0, "FileSystemHelper");
    qmlRegisterType<SettingsAdapter>("harbour.skippingstones", 1, 0, "SettingsAdapter");

    view->setSource(QUrl("/usr/share/harbour-skippingstones/qml/main.qml"));
    view->show();

    return app->exec();
}
int main(int argc, char *argv[])
{
  // SailfishApp::main() will display "qml/template.qml", if you need more
  // control over initialization, you can use:
  //
  //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
  //   - SailfishApp::createView() to get a new QQuickView * instance
  //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
  //
  // To display the view, call "show()" (will show fullscreen on device).
   QGuiApplication *app = SailfishApp::application(argc, argv);

  QQuickView *view = SailfishApp::createView();
  view->rootContext()->setContextProperty("Base64", new Base64);
  view->rootContext()->setContextProperty("FileUtils", new FileUtils);
  view->rootContext()->setContextProperty("ImageUtils", new ImageUtils);
  view->setSource(SailfishApp::pathTo("qml/cordova-sailfish.qml"));
  view->show();

  return app->exec();
}
示例#28
0
int main(int argc, char **argv)
{
	QGuiApplication *app = SailfishApp::application(argc, argv);
	
    qmlRegisterType<Mainview>("harbour.monav", 1, 0, "Mainview");
    qmlRegisterType<TapMenu>("harbour.monav", 1, 0, "TapMenu");
    qmlRegisterType<MapPackages>("harbour.monav", 1, 0, "MapPackages");
    qmlRegisterType<Bookmarks>("harbour.monav", 1, 0, "Bookmarks");
    qmlRegisterType<PaintWidget>("harbour.monav", 1, 0, "PaintWidget");
    qmlRegisterType<WorldMapChooser>("harbour.monav", 1, 0, "WorldMapChooser");

	QQuickView *view = SailfishApp::createView();
	view->setSource(SailfishApp::pathTo("qml/Main.qml"));
	view->show();
	view->setResizeMode(QQuickView::SizeRootObjectToView);
	QObject *object = (QObject *) view->rootObject();
	
	Mainview *mainview = object->findChild<Mainview *>("mainview");
	mainview->init();
	
	app->connect( app, SIGNAL(aboutToQuit()), MapData::instance(), SLOT(cleanup()) );
	app->connect( app, SIGNAL(aboutToQuit()), RoutingLogic::instance(), SLOT(cleanup()) );
	app->connect( app, SIGNAL(aboutToQuit()), Logger::instance(), SLOT(cleanup()) );
	
	app->connect( app, SIGNAL(aboutToQuit()), mainview, SLOT(cleanup()) );

	return app->exec();
}
示例#29
0
MainWindow::MainWindow(QGuiApplication& app, QWindow *parent) :
    QQuickView(parent)
{
    this->setSource(QUrl::fromLocalFile("qml/main.qml"));
    this->setWindowTitle("Tori");
    this->setResizeMode(QQuickView::SizeRootObjectToView);

    QScreen* screen = app.primaryScreen();
    this->setX(screen->availableGeometry().width() - this->width() - 20);
    this->setY(70);

    this->initializeTwitterAccess();
}
示例#30
0
int main(int argc, char *argv[])
{
    qmlRegisterUncreatableType<DataRepositoryObject>("harbour.twablet", 1, 0, "DataRepository", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<IModel>("harbour.twablet", 1, 0, "Model", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<AccountObject>("harbour.twablet", 1, 0, "Account", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<LayoutObject>("harbour.twablet", 1, 0, "Layout", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<QueryObject>("harbour.twablet", 1, 0, "Query", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<TweetObject>("harbour.twablet", 1, 0, "Tweet", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<UserObject>("harbour.twablet", 1, 0, "User", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<MediaObject>("harbour.twablet", 1, 0, "Media", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<MediaModel>("harbour.twablet", 1, 0, "MediaModel", QLatin1String("Uncreatable"));
    qmlRegisterUncreatableType<AbstractQueryItem>("harbour.twablet", 1, 0, "QueryItem", QLatin1String("Uncreatable"));
    qmlRegisterType<TwitterAuthentification>("harbour.twablet", 1, 0, "TwitterAuthentification");
    qmlRegisterType<AccountModel>("harbour.twablet", 1, 0, "AccountModel");
    qmlRegisterType<AccountSelectionModel>("harbour.twablet", 1, 0, "AccountSelectionModel");
    qmlRegisterType<LayoutModel>("harbour.twablet", 1, 0, "LayoutModel");
    qmlRegisterType<TweetModel>("harbour.twablet", 1, 0, "TweetModel");
    qmlRegisterType<QueryListModel>("harbour.twablet", 1, 0, "QueryListModel");
    qmlRegisterType<TweetQueryItem>("harbour.twablet", 1, 0, "TweetQueryItem");
    qmlRegisterType<UserQueryItem>("harbour.twablet", 1, 0, "UserQueryItem");
    qmlRegisterType<DescriptionFormatter>("harbour.twablet", 1, 0, "DescriptionFormatter");
    qmlRegisterType<TweetFormatter>("harbour.twablet", 1, 0, "TweetFormatter");
    qmlRegisterSingletonType<DataRepositoryObject>("harbour.twablet", 1, 0, "Repository",
                                                          [](QQmlEngine *e, QJSEngine *) -> QObject * {
        return new DataRepositoryObject(e);
    });

#ifndef DESKTOP
    return SailfishApp::main(argc, argv);
#else
    QGuiApplication app {argc, argv};
    QQuickView view {};
    view.setSource(QUrl(QLatin1String("qrc:/qml/harbour-twablet.qml")));
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    view.show();
    return app.exec();
#endif
}