当前位置: 首页>>代码示例>>C++>>正文


C++ QmlApplicationViewer::showExpanded方法代码示例

本文整理汇总了C++中QmlApplicationViewer::showExpanded方法的典型用法代码示例。如果您正苦于以下问题:C++ QmlApplicationViewer::showExpanded方法的具体用法?C++ QmlApplicationViewer::showExpanded怎么用?C++ QmlApplicationViewer::showExpanded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QmlApplicationViewer的用法示例。


在下文中一共展示了QmlApplicationViewer::showExpanded方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:30,代码来源:main.cpp

示例2: main

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();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:29,代码来源:main.cpp

示例3: main

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();
}
开发者ID:rabits,项目名称:rplay,代码行数:28,代码来源:main.cpp

示例4: main

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();
}
开发者ID:kolayuk,项目名称:BelleCleaner,代码行数:26,代码来源:main.cpp

示例5: main

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();
}
开发者ID:sailfishapps,项目名称:landed,代码行数:33,代码来源:main.cpp

示例6: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

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

    return app.exec();
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:10,代码来源:main.cpp

示例7: main

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();
}
开发者ID:bashor,项目名称:guideQML,代码行数:10,代码来源:main.cpp

示例8: main

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();
}
开发者ID:BGmot,项目名称:Qt,代码行数:11,代码来源:main.cpp

示例9: main

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();
}
开发者ID:e8johan,项目名称:contractioncounter,代码行数:11,代码来源:main.cpp

示例10: main

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();
}
开发者ID:Kwangsub,项目名称:qt-openwebos,代码行数:11,代码来源:main.cpp

示例11: main

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();
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:11,代码来源:main.cpp

示例12: main

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();
}
开发者ID:AnadoluPanteri,项目名称:helloqt5,代码行数:11,代码来源:main.cpp

示例13: main

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();
}
开发者ID:Afreeca,项目名称:qt,代码行数:11,代码来源:main.cpp

示例14: main

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();
}
开发者ID:sriks,项目名称:Imagesort,代码行数:11,代码来源:main.cpp

示例15: main

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> App(createApplication(argc, argv));

    QTranslator Translator;
    if (!Translator.load("tr_"+QLocale::system().name(), ":/i18n"))
        Translator.load("tr_en", ":/i18n");
    App->installTranslator(&Translator);

    ConTranslator ConsoleMsgs;
    ConsoleMsgs.load("conmsgs", ":/i18n");
    App->installTranslator(&ConsoleMsgs);

    IconProvider::SetToCurrentSystemTheme();

    Context Ctx(argc, argv);
    ScopedIntercomHandler Intercom;

    if (Ctx.IfExit())
        return Intercom->GetExitCode();

    {
        ModesModel ModesList(Ctx.CheckMode(), Ctx.CheckMode()==RunModes::PRINT);
        UsersModel UsersList(Ctx.GetTargetUser(), Ctx.CheckMode()==RunModes::PRINT);
        DesktopModel AppList;
        PswTools PassCheck;
        QmlApplicationViewer Viewer;

        qmlRegisterUncreatableType<RunModes>("com.lcferrum.hmtsu", 1, 0, "RunModes", "Exports RunModes enum to QML");
        Viewer.engine()->addImageProvider("icon", new IconProvider());      //It is QDeclarativeEngine's responsibility to destroy added image providers
        Viewer.rootContext()->setContextProperty("objModesList", &ModesList);
        Viewer.rootContext()->setContextProperty("objUsersList", &UsersList);
        Viewer.rootContext()->setContextProperty("objAppList", &AppList);
        Viewer.rootContext()->setContextProperty("objContext", &Ctx);
        Viewer.rootContext()->setContextProperty("objIntercom", &Intercom);
        Viewer.rootContext()->setContextProperty("objPassCheck", &PassCheck);
        Viewer.rootContext()->setContextProperty("HMTSU_VERSION_STRING", HMTSU_VERSION_STRING IF_DEBUG(" (DEBUG)"));
        Viewer.rootContext()->setContextProperty("HMTSU_COPYRIGHT_STRING", HMTSU_COPYRIGHT_STRING);
        Viewer.rootContext()->setContextProperty("CANCELED_EXIT_CODE", CANCELED_EXIT_CODE);
        Viewer.rootContext()->setContextProperty("DENIED_EXIT_CODE", DENIED_EXIT_CODE);
        Viewer.rootContext()->setContextProperty("NORMAL_EXIT_CODE", NORMAL_EXIT_CODE);
        Viewer.rootContext()->setContextProperty("MAX_PSW_ATTEMPTS", MAX_PSW_ATTEMPTS);

        Viewer.setSource(QUrl("qrc:/main.qml"));

        Viewer.showExpanded();

        App->exec();
    }

    Ctx.Run();

    return Intercom->GetExitCode();
}
开发者ID:lcferrum,项目名称:hmtsu,代码行数:54,代码来源:main.cpp


注:本文中的QmlApplicationViewer::showExpanded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。