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


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

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


在下文中一共展示了QmlApplicationViewer::setOrientation方法的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

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

示例3: main

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

    QmlApplicationViewer viewer;



    //system("sudo ifup wlan0");

     Downloader d;
     d.doDownload("http://www.vesta-tab.com/jo/showId.php");

    Object data;

    viewer.setCursor(Qt::BlankCursor);
    viewer.rootContext()->setContextProperty("image", &data);

    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    //viewer.setMainQmlFile("qrc:/main.qml");
    viewer.setSource(QUrl("qrc:/qml/BBB/main.qml"));
    viewer.showFullScreen();

    return app->exec();
}
开发者ID:Aginorty,项目名称:vesta,代码行数:26,代码来源:main.cpp

示例4: main

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

示例5: 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

示例6: main

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

    // Localization: Loads the application translation depending on the mobile language.
    QTranslator translator;
    QString locale = QLocale::system().name();
    translator.load("qml_" + locale, ":/qml/i18n/");
    app.installTranslator(&translator);

    UserAgentProvider p;
    QString userAgent = p.getUserAgent();

    NetworkAccessManagerFactory factory(userAgent);

    QmlApplicationViewer viewer;
    viewer.engine()->setNetworkAccessManagerFactory(&factory);
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setSource(QUrl("qrc:///qml/main.qml"));

    // Performance operations
    viewer.setAttribute(Qt::WA_OpaquePaintEvent);
    viewer.setAttribute(Qt::WA_NoSystemBackground);
    viewer.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
    viewer.viewport()->setAttribute(Qt::WA_NoSystemBackground);
    viewer.window()->showFullScreen();
    viewer.engine()->networkAccessManager()->cache()->clear();

    return app.exec();
}
开发者ID:haorenhl007,项目名称:QML-SMPlayer,代码行数:30,代码来源:main.cpp

示例7: 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

示例8: 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

示例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/TestApp2/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
开发者ID:n9dyfi,项目名称:TestApp2,代码行数:11,代码来源:main.cpp

示例10: 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

示例11: 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

示例12: main

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

示例13: main

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

示例14: main

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

示例15: main

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();
}
开发者ID:alvarofagner,项目名称:bcast-observer-demos,代码行数:13,代码来源:main.cpp


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