本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}