diff options
Diffstat (limited to 'examples/bluetooth/heartrate-game/main.cpp')
-rw-r--r-- | examples/bluetooth/heartrate-game/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/bluetooth/heartrate-game/main.cpp b/examples/bluetooth/heartrate-game/main.cpp index 11573512..50f891e1 100644 --- a/examples/bluetooth/heartrate-game/main.cpp +++ b/examples/bluetooth/heartrate-game/main.cpp @@ -48,9 +48,9 @@ int main(int argc, char *argv[]) {u"deviceHandler"_s, QVariant::fromValue(&deviceHandler)} }); - engine.load(QUrl(u"qrc:/qml/main.qml"_s)); - if (engine.rootObjects().isEmpty()) - return -1; + QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app, + []() { QCoreApplication::exit(1); }, Qt::QueuedConnection); + engine.loadFromModule("HeartRateGame", "Main"); return app.exec(); } |