main.cpp 558 B

12345678910111213141516171819
  1. #include <QGuiApplication>
  2. #include <QQuickView>
  3. int main(int argc, char* argv[])
  4. {
  5. QGuiApplication app(argc,argv);
  6. QQuickView view;
  7. view.setResizeMode(QQuickView::SizeRootObjectToView);
  8. view.setSource(QUrl::fromLocalFile(QCoreApplication::applicationDirPath() + QLatin1String("/Qt5_CinematicExperience.qml")));
  9. const QString lowerArgument = QString::fromLatin1(argv[1]).toLower();
  10. if (lowerArgument == QLatin1String("--fullscreen")) {
  11. view.showFullScreen();
  12. } else {
  13. view.show();
  14. }
  15. return app.exec();
  16. }