本文整理汇总了C++中QmlApplicationViewer::setMainQmlFile方法的典型用法代码示例。如果您正苦于以下问题:C++ QmlApplicationViewer::setMainQmlFile方法的具体用法?C++ QmlApplicationViewer::setMainQmlFile怎么用?C++ QmlApplicationViewer::setMainQmlFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QmlApplicationViewer
的用法示例。
在下文中一共展示了QmlApplicationViewer::setMainQmlFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例3: 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();
}
示例4: 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();
}
示例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();
}
示例6: 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();
}
示例7: main
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();
}
示例8: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer viewer;
viewer.setMainQmlFile(QLatin1String("qml/gallery/main.qml"));
viewer.show();
return app.exec();
}
示例9: 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();
}
示例10: 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();
}
示例11: 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();
}
示例12: 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();
}
示例13: 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();
}
示例14: 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();
}
示例15: 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();
}