diff options
author | Bernd Weimer <bernd.weimer@pelagicore.com> | 2019-12-10 12:12:11 +0100 |
---|---|---|
committer | Bernd Weimer <bernd.weimer@pelagicore.com> | 2020-01-17 19:42:54 +0100 |
commit | b05e55717ecb0affa00ac337aecf7066aa78a2a5 (patch) | |
tree | 47e35770db8e8244eeb1b436dfb3799d90f6f7c2 | |
parent | 0c69e083ac5f5e97c9da09bdf1bd979dbe87ea93 (diff) |
Revise some error handling
Show critical message, if an application's QML cannot be loaded.
Change-Id: Ie1a6f0632861cb17af91c5ead297f1b6512fd3c0
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r-- | src/manager-lib/qmlinprocessruntime.cpp | 4 | ||||
-rw-r--r-- | src/tools/launcher-qml/launcher-qml.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/manager-lib/qmlinprocessruntime.cpp b/src/manager-lib/qmlinprocessruntime.cpp index 099d0a64..f3ac72d4 100644 --- a/src/manager-lib/qmlinprocessruntime.cpp +++ b/src/manager-lib/qmlinprocessruntime.cpp @@ -135,7 +135,9 @@ bool QmlInProcessRuntime::start() QQmlComponent *component = new QQmlComponent(m_inProcessQmlEngine, m_app->nonAliasedInfo()->absoluteCodeFilePath()); if (!component->isReady()) { - qCDebug(LogSystem) << "qml-file (" << m_app->nonAliasedInfo()->absoluteCodeFilePath() << "): component not ready:\n" << component->errorString(); + qCCritical(LogSystem).noquote().nospace() << "Failed to load component " + << m_app->nonAliasedInfo()->absoluteCodeFilePath() + << ":\n" << component->errorString(); return false; } diff --git a/src/tools/launcher-qml/launcher-qml.cpp b/src/tools/launcher-qml/launcher-qml.cpp index 12ac1ef3..77f1520a 100644 --- a/src/tools/launcher-qml/launcher-qml.cpp +++ b/src/tools/launcher-qml/launcher-qml.cpp @@ -461,7 +461,7 @@ void Controller::startApplication(const QString &baseDir, const QString &qmlFile auto topLevels = m_engine.rootObjects(); if (Q_UNLIKELY(topLevels.isEmpty() || !topLevels.at(0))) { - qCCritical(LogSystem) << "could not load" << qmlFile << ": no root object"; + qCCritical(LogSystem) << "Failed to load component" << qmlFile << ": no root object"; QCoreApplication::exit(3); return; } |