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


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

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


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

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

示例2: QMainWindow

MuseBox::MuseBox(QWidget *parent) :
    QMainWindow(parent)
{
    //TODO add a splash screen here? would be totally fun!
    qmlRegisterType<TrackArrangementBackground>("TrackArrangement",1,0,"TrackArrangementBackground");
    qmlRegisterType<CursorRuler>("TrackArrangement",1,0,"CursorRuler");
    qmlRegisterType<PatternModel>("DataModel",1,0,"PatternModel");
    qmlRegisterType<NoteModel>("DataModel",1,0,"NoteModel");
    qmlRegisterType<PatternDisplay>("TrackArrangement",1,0,"PatternDisplay");
    qmlRegisterType<PatternNoteDisplay>("TrackArrangement",1,0,"PatternNoteDisplay");
    QmlApplicationViewer *view = new QmlApplicationViewer();
    view->rootContext()->setContextProperty("musebox", this);
    view->rootContext()->setContextProperty("trackModel", &this->trackModel);
    view->setSource(QUrl::fromLocalFile("qml/MuseBox/main.qml"));
    view->setResizeMode(QDeclarativeView::SizeRootObjectToView);


    QGLFormat format = QGLFormat::defaultFormat();
    format.setSampleBuffers(false);
    QGLWidget *glWidget = new QGLWidget(format);
    glWidget->setAutoFillBackground(false);
    view->setViewport(glWidget);

    setCentralWidget(view);
    Hardware::Init();
    view->rootContext()->setContextProperty("transposeMachine", Hardware::TransposeMachine);
    Hardware::StartAudio();
}
开发者ID:lmaxwell,项目名称:MuseBox,代码行数:28,代码来源:musebox.cpp

示例3: main

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

示例4: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setApplicationName("BBSimpleCalc ");
       app.setApplicationVersion("1.0rc LGPL 3.0 lic.");
       app.setOrganizationName("Silesian University of Technology Students");
    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setResizeMode(QmlApplicationViewer::SizeRootObjectToView);
    viewer.setSource(QUrl("qrc:/qml/main.qml"));
    viewer.setWindowState(Qt::WindowFullScreen);
    viewer.showExpanded();

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

示例5: main

int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QCoreApplication::setApplicationName("Test QML");

    qmlRegisterType<VlcQMLVideoPlayer>("VLCQt", 0, 6, "VlcVideoPlayer");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile("qml/video.qml");
    viewer.setResizeMode(QDeclarativeView::SizeViewToRootObject);
    viewer.showExpanded();

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

示例6: main

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

    QmlApplicationViewer viewer;
        viewer.setAttribute(Qt::WA_LockPortraitOrientation);
        Helper helper;
        viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
        viewer.rootContext()->setContextProperty("Helper", &helper);
        viewer.setAttribute(Qt::WA_OpaquePaintEvent);
        viewer.setAttribute(Qt::WA_NoSystemBackground);
        viewer.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
        viewer.viewport()->setAttribute(Qt::WA_NoSystemBackground);
        viewer.setSource(QUrl("qrc:/qml/main.qml"));
    viewer.showFullScreen();

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

示例7: main

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

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    QDir dir = QDir(QDir::home());
    dir.cd("Videos");
    dir.setFilter(QDir::Files);
    QStringList entries = dir.entryList();
    QDeclarativeContext *ctxt = viewer.rootContext();
    ctxt->setContextProperty("filesModel", QVariant::fromValue(entries));
    ctxt->setContextProperty("filesRoot", QVariant::fromValue(dir.absolutePath()));

    QPixmap nullCursor(16, 16);
    nullCursor.fill(Qt::transparent);
//    QApplication::setOverrideCursor(QCursor(nullCursor));
    viewer.setMainQmlFile(QLatin1String("qml/nakkikioski/main.qml"));
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showExpanded();
    viewer.showFullScreen();

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


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