本文整理汇总了C++中QQuickView::showFullScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ QQuickView::showFullScreen方法的具体用法?C++ QQuickView::showFullScreen怎么用?C++ QQuickView::showFullScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQuickView
的用法示例。
在下文中一共展示了QQuickView::showFullScreen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QGuiApplication app(argc, argv);
#else
QApplication app(argc, argv);
#endif
app.setProperty("NoMStyle", QVariant(true));
QDir::setCurrent(app.applicationDirPath());
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QQuickView window;
#else
QDeclarativeView window;
#endif
window.setSource(QUrl("qrc:/main.qml"));
#ifdef __arm__
window.showFullScreen();
#else
window.show();
#endif
return app.exec();
}
示例2: main
int main(int argc, char** argv)
{
QCoreApplication::setOrganizationName("com.ubuntu.developer.mzanetti.kodimote");
QCoreApplication::setApplicationName("kodimote");
QGuiApplication application(argc, argv);
// Load language file
QString language = QLocale::system().bcp47Name();
qDebug() << "got language:" << language;
QTranslator qtTranslator;
if(!qtTranslator.load("qt_" + language, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
qDebug() << "couldn't load qt_" + language;
}
application.installTranslator(&qtTranslator);
QTranslator translator;
if (!translator.load(":/kodimote_" + language + ".qm")) {
qDebug() << "Cannot load translation file" << "kodimote_" + language + ".pm";
}
application.installTranslator(&translator);
Kodi::instance()->setDataPath(QDir::homePath() + "/.cache/com.ubuntu.developer.mzanetti.kodimote/");
Kodi::instance()->eventClient()->setApplicationThumbnail("kodimote80.png");
QQuickView *view = new QQuickView();
Settings settings;
UbuntuHelper helper(view, &settings);
ProtocolManager protocols;
MprisController controller(&protocols, &helper);
Q_UNUSED(controller)
view->setResizeMode(QQuickView::SizeRootObjectToView);
view->engine()->setNetworkAccessManagerFactory(new NetworkAccessManagerFactory());
view->setTitle("Kodimote");
view->engine()->rootContext()->setContextProperty("kodi", Kodi::instance());
view->engine()->rootContext()->setContextProperty("settings", &settings);
view->engine()->rootContext()->setContextProperty("protocolManager", &protocols);
view->setSource(QUrl("qrc:///qml/main.qml"));
if(QGuiApplication::arguments().contains("--fullscreen")) {
view->showFullScreen();
} else {
// view->resize(QSize(720, 1280));
view->show();
}
return application.exec();
}
示例3: main
Q_DECL_EXPORT int main(int argc, char *argv[]) {
QGuiApplication *lApplication = new QGuiApplication(argc, argv);
QQuickView *lView = new QQuickView;
lView->setResizeMode(QQuickView::SizeRootObjectToView);
QVariantList lLevelList;
createAllLevels(lLevelList);
lView->rootContext()->setContextProperty(QStringLiteral("gLevels"), lLevelList);
QNetworkAccessManager lNetworkManager;
LevelModel *lLevelModel = new LevelModel(lLevelList.count(), &lNetworkManager, lApplication);
lView->rootContext()->setContextProperty(QStringLiteral("gLevelModel"), lLevelModel);
HighScoresModel *lHighScoresModel = new HighScoresModel(lApplication);
lView->rootContext()->setContextProperty(QStringLiteral("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->setSource(QStringLiteral("qrc:///qml/Game.qml"));
lView->showFullScreen();
return lApplication->exec();
}
示例4: main
int main(int argc, char* argv[])
{
QGuiApplication app(argc,argv);
qmlRegisterType<Connector>("Connector", 1, 0, "Connector");
app.setOrganizationName("QtProject");\
app.setOrganizationDomain("qt-project.org");\
app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
QQuickView view;\
if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {\
QSurfaceFormat f = view.format();\
f.setProfile(QSurfaceFormat::CoreProfile);\
f.setVersion(4, 4);\
view.setFormat(f);\
}\
view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
new QQmlFileSelector(view.engine(), &view);\
view.setSource(QUrl("qrc:///demos/tweetsearch/tweetsearch.qml")); \
view.setResizeMode(QQuickView::SizeRootObjectToView);\
if (QGuiApplication::platformName() == QLatin1String("qnx") || \
QGuiApplication::platformName() == QLatin1String("eglfs")) {\
view.showFullScreen();\
} else {\
view.show();\
}\
return app.exec();\
}
示例5: main
/*------------------------------------------------------------------------------
| main
+-----------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
QApplication a(argc, argv);
QStringList args = a.arguments();
const bool opengl = !args.contains("--no-opengl");
args.removeAll("--no-opengl");
if (opengl) {
qDebug("QML QtWebEngine...");
QQuickView* view = new QQuickView;
view->setSource(QUrl("qrc:/poc_main.qml"));
view->showFullScreen();
QObject* o = view->rootObject()->findChild<QObject*>("webEngineView");
o->setProperty("url", args.at(1));
}
else {
qDebug("Widget QtWebEngine...");
QWebEngineView* view = new QWebEngineView;
view->load(QUrl(args.at(1)));
view->show();
}
return a.exec();
}
示例6: main
int main(int argc, char *argv[])
{
QGuiApplication app(argc,argv);
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit()));
view.setSource(QUrl("qrc:///LoginContainer.qml"));
view.resize(800, 480);
view.showFullScreen();
return app.exec();
}
示例7: main
int main(int argc, char *argv[])
{
QGuiApplication *app = SailfishApp::application(argc, argv);
QString locale = QLocale::system().name();
QTranslator translator;
translator.load(locale,SailfishApp::pathTo(QString("localization")).toLocalFile());
app->installTranslator(&translator);
QQuickView *view = SailfishApp::createView();
view->setSource(SailfishApp::pathTo("qml/main.qml"));
view->showFullScreen();
return app->exec();
}
示例8: main
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
QQuickView view;
qDebug() << "Welcome to my SmartDevCon 2012 presentation!";
QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl("qrc:/qml/Main.qml"));
view.showFullScreen();
return app.exec();
}
示例9: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
qmlRegisterType<FileIO, 1>("FileIO", 1, 0, "FileIO");
// MyQuickView w;
// w.resize(400,700);
// w.show();
QQuickView view;
view.setSource(QUrl("qrc:/gameMainUi.qml"));
view.setFlags(Qt::FramelessWindowHint |Qt::WindowStaysOnTopHint);
view.showFullScreen();
return a.exec();
}
示例10: main
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
QQuickView window;
window.setSource(QUrl("qrc:/main.qml"));
#ifdef __arm__
window.showFullScreen();
#else
window.resize(window.initialSize().width(), window.initialSize().height());
window.show();
#endif
return app.exec();
}
示例11: main
int main(int argc, char* argv[])
{
pthread_t trade_thread, md_thread;
QGuiApplication app(argc,argv);
qmlRegisterType<Graph>("Graph", 1, 0, "Graph");
app.setOrganizationName("QtProject");
app.setOrganizationDomain("qt-project.org");
app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());
QQmlEngine engine;
QQmlComponent component(&engine, QUrl("qrc:///demos/stocqt/content/Tradepanel.qml"));
// if( component.status != component.Ready )
// {
// if( component.status == component.Error )
// console.debug("Error:"+ component.errorString() );
// return; // or maybe throw
// }
object = component.create();
QQuickView view;
tradepanel.object=object;
PublicFuncs tradeFun(object);
view.rootContext()->setContextProperty("myObject", &tradepanel);
view.rootContext()->setContextProperty("myObject_t", &tradeFun);
if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {
QSurfaceFormat f = view.format();
f.setProfile(QSurfaceFormat::CoreProfile);
f.setVersion(4, 4);
view.setFormat(f);
}
view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
new QQmlFileSelector(view.engine(), &view);
view.setSource(QUrl("qrc:///demos/stocqt/stocqt.qml"));
view.setResizeMode(QQuickView::SizeRootObjectToView);
if (QGuiApplication::platformName() == QLatin1String("qnx") ||
QGuiApplication::platformName() == QLatin1String("eglfs")) {
view.showFullScreen();
} else {
view.show();
}
pthread_create(&md_thread, NULL, Msclient, NULL);
pthread_create(&trade_thread, NULL, trade_main, NULL);
return app.exec();
}
示例12: qDebug
int MascaraInterfaceV1::showDialog(const QString &dialogType)
{
qDebug() << Q_FUNC_INFO << "Showing " << dialogType;
int serialNo = m_windowSerial++;
QQuickView *view = new QQuickView;
m_windows.insert(serialNo, view);
view->setSource(QUrl::fromLocalFile("/home/nemo/dialogs/" + dialogType + "/" + dialogType + ".qml"));
// HACK
connect(view->engine(), SIGNAL(quit()), QGuiApplication::instance(), SLOT(quit()));
view->showFullScreen();
view->create(); // TODO: better to hook to expose? lazy
QGuiApplication::platformNativeInterface()->setWindowProperty(view->handle(), QLatin1String("CATEGORY"), QLatin1String("dialog"));
view->setProperty("MascaraWindowId", serialNo);
m_closeTimer.stop();
view->installEventFilter(this);
return serialNo;
}
示例13: main
int main(int argc, char *argv[])
{
QGuiApplication *app = SailfishApp::application(argc, argv);
QQuickView *view = SailfishApp::createView();
Settings *settings = new Settings();
// SailfishApp::main() will display "qml/template.qml", if you need more
// control over initialization, you can use:
//
// - SailfishApp::application(int, char *[]) to get the QGuiApplication *
// - SailfishApp::createView() to get a new QQuickView * instance
// - SailfishApp::pathTo(QString) to get a QUrl to a resource file
//
// To display the view, call "show()" (will show fullscreen on device).
view->rootContext()->setContextProperty("settings", settings);
view->setSource(SailfishApp::pathTo("qml/harbour-scocadigo.qml"));
view->showFullScreen();
return app->exec();
}
示例14: main
int main(int argc, char* argv[])
{
QGuiApplication app(argc,argv);
QQuickView view;
GameData *game = new GameData();
view.engine()->rootContext()->setContextObject(game);
view.engine()->rootContext()->setContextProperty("gameData", game);
view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
view.setSource(QUrl::fromLocalFile(QString("rsc/main.qml")));
if (QGuiApplication::platformName() == QLatin1String("qnx") ||
QGuiApplication::platformName() == QLatin1String("eglfs")) {
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.showFullScreen();
} else {
view.show();
}
return app.exec();
}
示例15: main
int main(int argc, char **argv)
{
qputenv("QT_LOGGING_RULES", "qt.qpa.*=true");
qputenv("QSG_INFO", "1");
QGuiApplication app(argc, argv);
QList<QScreen *> screens = app.screens();
qDebug("Application sees %d screens", screens.count());
qDebug() << screens;
QVector<QQuickView *> views;
for (int i = 0; i < screens.count(); ++i) {
QQuickView *v = addView(screens[i], i);
views.append(v);
v->showFullScreen();
}
int r = app.exec();
qDeleteAll(views);
return r;
}