Example #1
0
File: main.cpp Project: khris/qv
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);

#ifdef Q_OS_SYMBIAN
    viewer.setMainQmlFile(QLatin1String("qrc:/qml/qvapp/qv.qml"));
    viewer.setSource(QUrl(QLatin1String("qrc:/qml/qvapp/qv.qml")));
#else
    viewer.setMainQmlFile(QLatin1String("qml/qvapp/qv.qml"));
#endif

#ifdef Q_OS_SYMBIAN
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showFullScreen();
#elif defined(Q_WS_MAEMO_5)
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showMaximized();
#elif defined(Q_OS_ANDROID)
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showFullScreen();
#else
    Qt::WindowFlags flags = Qt::MSWindowsFixedSizeDialogHint
            | Qt::CustomizeWindowHint
            | Qt::WindowCloseButtonHint
            | Qt::WindowMinimizeButtonHint;
    viewer.setWindowFlags(flags);
    viewer.setResizeMode(QDeclarativeView::SizeViewToRootObject);
    viewer.show();
#endif

    return app.exec();
}
Example #2
0
int main(int argc, char *argv[])
{
// Depending on which is the recommended way for the platform, either use
// opengl graphics system or paint into QGLWidget.
#ifdef SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
    QApplication::setGraphicsSystem("opengl");
#endif

    QApplication app(argc, argv);
    QmlApplicationViewer viewer;

#ifndef SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
    QGLFormat format = QGLFormat::defaultFormat();
    format.setSampleBuffers(false);
    format.setSwapInterval(1);
    QGLWidget* glWidget = new QGLWidget(format);
    glWidget->setAutoFillBackground(false);
    viewer.setViewport(glWidget);
#endif

    viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
    viewer.setAttribute(Qt::WA_OpaquePaintEvent);
    viewer.setAttribute(Qt::WA_NoSystemBackground);
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/shadereffects/main.qml"));
    QObject::connect(viewer.engine(), SIGNAL(quit()), &viewer, SLOT(close()));
    viewer.showExpanded();

    return app.exec();
}
Example #3
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{

#if defined(Q_OS_SYMBIAN)
    int platformId = 0;
#elif defined(Q_WS_MAEMO_5)
    int platformId = 1;
#elif defined(Q_WS_MAEMO_6)
    int platformId = 2;
#elif defined(QT_WS_SIMULATOR)
    int platformId = 3;
#elif defined(QT_SIMULATOR)
    int platformId = 4;
#elif defined(Q_OS_MAC64)
    int platformId = 5;
#elif defined(Q_WS_MEEGO)
    int platformId = 6;
#else
    // desktop probably
    int platformId = 99;
#endif


    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.rootContext()->setContextProperty("platform",  platformId);
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/landedsettings21/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #4
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    qDebug("[rPlay] Init rPlay v"PROJECT_VERSION);

    QCoreApplication::setOrganizationName("Rabits");
    QCoreApplication::setOrganizationDomain("rabits.ru");
    QCoreApplication::setApplicationName("rplay");
    QCoreApplication::setApplicationVersion(PROJECT_VERSION);

    QScopedPointer<QApplication> app(createApplication(argc, argv));

    qmlRegisterType<ListModel>("ListModels", 1, 0, "ListModel");

    QmlApplicationViewer viewer;

    qDebug("[rPlay] Creating context");
    CPlayer::getInstance()->initContext(viewer, &app);

    qDebug("[rPlay] Loading qml");
    viewer.setMainQmlFile(QLatin1String("qml/rplay/main.qml"));

    CPlayer::getInstance()->initRoot(viewer);

    qDebug("[rPlay] Init done, starting");

    viewer.showExpanded();
    return app->exec();
}
int main(int argc, char ** argv)
{
    QUrl source("qml/networkaccessmanagerfactory/view.qml");

    QApplication app(argc, argv);
    QmlApplicationViewer viewer;

    for (int i = 1; i < argc; ++i) {
        QString arg(argv[i]);
        if (arg == "-host" && i < argc-1) {
            proxyHost = argv[++i];
        } else if (arg == "-port" && i < argc-1) {
            arg = argv[++i];
            proxyPort = arg.toInt();
        } else if (arg[0] != '-') {
            source = QUrl::fromLocalFile(arg);
        } else {
            qWarning() << "Usage: networkaccessmanagerfactory [-host <proxy> -port <port>] [file]";
            exit(1);
        }
    }

    viewer.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory);
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setMainQmlFile(source.toString());
    viewer.showExpanded();

    return app.exec();
}
Example #6
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QFile file("D:\\pureclean.txt");
    if (file.exists()){file.remove();}
    //qInstallMsgHandler(myMessageHandler);
    //QCoreApplication::setAttribute(Qt::AA_S60DisablePartialScreenInputMode, true);

    QTranslator myTranslator;
      myTranslator.load("bellecleaner_" + QLocale::system().name());
      app.data()->installTranslator(&myTranslator);

    //qt_s60_setPartialScreenAutomaticTranslation(false);
    //qt_s60_setPartialScreenInputMode(true);
    QmlApplicationViewer viewer;
    qmlRegisterType<DeleteItem>("App", 1,0,"DeleteItem");
    Application* a=new Application();
    FileModel fileModel;
    viewer.rootContext()->setContextProperty("fileModel", &fileModel);
    viewer.rootContext()->setContextProperty("application",a);
    //viewer.rootContext()->setContextProperty("mymodel",QVariant::fromValue(a->getCategoryModel()));
    viewer.setMainQmlFile(QLatin1String("qml/PureClean/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #7
0
Q_DECL_EXPORT int main(int argc, char *argv[]) {
	QApplication *lApplication = createApplication(argc, argv);
	QmlApplicationViewer *lView = QmlApplicationViewer::create();

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

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

	HighScoresModel *lHighScoresModel = new HighScoresModel(lApplication);
	lView->rootContext()->setContextProperty(QLatin1String("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->setMainQmlFile(QLatin1String("qml/Game.qml"));
	lView->showFullScreen();

	return lApplication->exec();
}
Example #8
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QmlApplicationViewer viewer;
    viewer.setMainQmlFile(QLatin1String("qml/gallery/main.qml"));
    viewer.show();

    return app.exec();
}
Example #9
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setMainQmlFile(QLatin1String("qml/BatteryStatus/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
Example #10
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setMainQmlFile(QLatin1String("qml/guide/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #11
0
int main(int argc, char *argv[])
{
    QScopedPointer<QCoreApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/helloqt5/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #12
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    ImageProvider engine;
    QmlApplicationViewer viewer;
    viewer.rootContext()->setContextProperty("imageengine",(QObject*)&engine);
    viewer.engine()->addImageProvider(QLatin1String("sortedimages"),&engine);
    viewer.setMainQmlFile(QLatin1String("qml/Imagesort/main.qml"));
    viewer.showExpanded();
    return app->exec();
}
Example #13
0
File: main.cpp Project: BGmot/Qt
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
    viewer.setMainQmlFile(QLatin1String("qml/qml/highlight.qml"));
    viewer.showExpanded();

    return app.exec();
}
Example #14
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/contractioncounter/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #15
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setMainQmlFile(QLatin1String("qml/slideswitch/slideswitch.qml"));
    viewer.showExpanded();

    return app.exec();
}
Example #16
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/sqllocalstorage/hello.qml"));
    viewer.showExpanded();

    return app.exec();
}
Example #17
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/threadedlistmodel/timedisplay.qml"));
    viewer.showExpanded();

    return app.exec();
}
Example #18
0
File: main.cpp Project: Afreeca/qt
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/dialcontrol/dialcontrol.qml"));
    viewer.showExpanded();

    return app.exec();
}
Example #19
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    qmlRegisterType<Utils>("Utils", 1,0, "Utils");
    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/MyReader/main.qml"));
    viewer.showFullScreen();


    return app.exec();
}
Example #20
0
QTM_USE_NAMESPACE

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QCoreApplication::setOrganizationName("Synchroma");
    QCoreApplication::setOrganizationDomain("synchroma.com.au");
    QCoreApplication::setApplicationName("Arca");

    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QmlApplicationViewer viewer;

    QDeclarativeEngine *engine = viewer.engine();
    QDeclarativeContext *context = engine->rootContext();

    DBSession session;
    session.setConsumerKey(DROPBOX_APP_KEY);
    session.setConsumerSecret(DROPBOX_APP_SECRET);

    // Have the REST client visible in the QML
    DBRestClient restClient(session);
    context->setContextProperty("restClient", &restClient);

    // TESTING
    context->setContextProperty("param", QString(argv[1]));

    // TESTING
    qDebug() << "temp dir: " << QDir::tempPath();
    qDebug() << "home dir: " << QDir::homePath();
    qDebug() << "current dir: " << QDir::currentPath();

    QServiceManager serviceManager(QService::SystemScope);
    QStringList stringList = serviceManager.findServices();
    foreach (QString interfaceName, stringList)
        qDebug() << "service interface: " << interfaceName;

    QList<QServiceInterfaceDescriptor> descriptors = serviceManager.findInterfaces();
    for (int i=0; i<descriptors.count(); i++)
    {
        QString service = descriptors[i].serviceName();

        if (descriptors[i].scope() == QService::SystemScope)
            service += " (system)";

        qDebug() << "service: " << service;
    }

    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/arca/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    qmlRegisterType<WallClockSetter>("com.indt.components", 1, 0, "WallClockSetter");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/broadcaster/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #22
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    ServerComm sc;
    QmlApplicationViewer viewer;
    viewer.rootContext()->setContextProperty("serverComm", &sc);
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/CuteSoma/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #23
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    qmlRegisterType<QDeclarativeCamera>("Camera", 1, 0, "Camera");
    QmlApplicationViewer viewer;
    viewer.setViewport(new QGLWidget());
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setMainQmlFile(QLatin1String("qml/photo/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    qmlRegisterType<FileIO, 1>("FileIO", 1, 0, "FileIO");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/mdb1_qtproject/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #25
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    qmlRegisterType<Settings>("org.dragly", 1, 0, "Settings");

    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/Bill/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
Example #26
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QZXing::registerQMLTypes();

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    qmlRegisterType<DropArea>("DropArea", 1, 0, "DropArea");
    viewer.setMainQmlFile(QLatin1String("qml/QZXingTestApp/main_QtQuick1.qml"));
#else
    QGuiApplication* app = new QGuiApplication(argc, argv);

    QZXing::registerQMLTypes();

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/QZXingTestApp/main_QtQuick2.qml"));
#endif
    viewer.showExpanded();

    return app->exec();
}
Example #27
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    app->setApplicationName ("9News");
    app->setOrganizationName ("Stars");
    app->setApplicationVersion ("0.0.1");

    qmlRegisterType<SelectFilesDialog>("com.stars.widgets", 1, 0, "FilesDialog");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);

    viewer.engine()->rootContext()->setContextProperty("fileDialog", new SelectFilesDialog());
#ifdef HARMATTAN_BOOSTER
    viewer.setMainQmlFile(QLatin1String("qml/meego/main.qml"));
#else
    viewer.setMainQmlFile(QLatin1String("qml/symbian/main.qml"));
#endif
    viewer.showExpanded();

    return app->exec();
}
Example #28
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    qmlRegisterType<ShipRotation>("SpaceDebris", 1, 0, "ShipRotation");
    qmlRegisterType<SpaceAudio>("SpaceDebris", 1, 0, "SpaceAudio");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setResizeMode(QmlApplicationViewer::SizeRootObjectToView);
    viewer.setMainQmlFile(QLatin1String("qml/spacerace/main.qml"));
    viewer.showFullScreen();

    return app.exec();
}
Example #29
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.addImportPath(QLatin1String("modules"));
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("../../KANR/qml/KANR/main.qml"));
    viewer.showExpanded();

    Manager manager(new Sinus(), viewer.rootObject());

    return app->exec();
}
Example #30
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QmlApplicationViewer viewer;

    RomFilter filter; // = new RomFilter();
    viewer.rootContext()->setContextProperty("romModel", filter.model());
    viewer.rootContext()->setContextProperty("romFilter", &filter);
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/qmlSelector/main.qml"));
    viewer.showExpanded();

    return app.exec();
}