From 180e995f33031bcfd30fde1aabc9b039f0a9fa3c Mon Sep 17 00:00:00 2001 From: vslg Date: Thu, 3 Sep 2020 12:23:20 -0300 Subject: [PATCH] Print Window.qml component creation errors --- src/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 349b4ce2..3b771daa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -181,6 +181,20 @@ int main(int argc, char *argv[]) { &engine, qrcPath.exists() ? "qrc:/src/gui/Window.qml" : "src/gui/Window.qml" ); + + if (component.isError()) { + for (QQmlError e : component.errors()) { + qFatal( + "%s:%d:%d: %s", + e.url().toString().toStdString().c_str(), + e.line(), + e.column(), + e.description().toStdString().c_str() + ); + } + app.exit(EXIT_FAILURE); + } + component.create(objectContext); // Finally, execute the app. Return its system exit code when it exits.