Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. void MyApp::load(QQmlApplicationEngine &engine)
  2. {
  3.     const QUrl url(QStringLiteral("qrc:/qml/myapp.qml"));
  4.     connect(&engine, &QQmlApplicationEngine::objectCreated, this, [url](QObject *obj, const QUrl &objUrl)
  5.     {
  6.         if (!obj && url == objUrl)
  7.             QCoreApplication::exit(-1);
  8.     }, Qt::QueuedConnection);
  9.  
  10.     engine.load(url);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement