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-21 16:41:00 +0100 |
commit | c67cfef563cab000835386d157dcb221a6c18878 (patch) | |
tree | 3611d06eb3e4ea48aa7115160ab3a0915d253d3d | |
parent | 533724b238ec6da240e01f7e5bff594f5b74f144 (diff) |
Revise some error handling
Show critical message, if an application's QML cannot be loaded.
Cherry-picked from 5.13: b05e557
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 788e22d2..52f59e5b 100644 --- a/src/manager-lib/qmlinprocessruntime.cpp +++ b/src/manager-lib/qmlinprocessruntime.cpp @@ -124,7 +124,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 7b25117f..d5157489 100644 --- a/src/tools/launcher-qml/launcher-qml.cpp +++ b/src/tools/launcher-qml/launcher-qml.cpp @@ -417,7 +417,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; } |