Skip to content

Instantly share code, notes, and snippets.

@aneury1
Created April 10, 2023 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aneury1/cde2c3b2c1b6e570dee1ac8483474426 to your computer and use it in GitHub Desktop.
Save aneury1/cde2c3b2c1b6e570dee1ac8483474426 to your computer and use it in GitHub Desktop.
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
const QUrl url( "qrc:/main.qml" );
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app,
[url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
},
Qt::QueuedConnection);
engine.load(url);
return app.exec();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment