本文整理汇总了C++中QmlApplicationViewer类的典型用法代码示例。如果您正苦于以下问题:C++ QmlApplicationViewer类的具体用法?C++ QmlApplicationViewer怎么用?C++ QmlApplicationViewer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QmlApplicationViewer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例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();
}
示例3: 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();
}
示例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
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();
}
示例6: 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();
}
示例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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: 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();
}
示例12: 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();
}
示例13: 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();
}
示例14: 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();
}
示例15: 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();
}