aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorIvan Tkachenko <me@ratijas.tk>2021-11-01 13:33:15 +0300
committerIvan Tkachenko <me@ratijas.tk>2021-11-02 21:37:04 +0300
commita78656aa02b1be36dbe09cddac2e8c21c4d7a126 (patch)
treefb5e936adb99f084a91439f4d1956122a3e583d8 /src/qml/qml
parent32d7aa27bb5fa0d1f6ede8bf074a868ac56e0118 (diff)
QQmlComponent: Skip the logging loop completely if category is not enabled
This is meant as an optimization. Pick-to: 6.2 Change-Id: Ied55c6177669165b82b871ff89703b69336e81b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 2d71274f16..63305620b9 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -938,9 +938,10 @@ QObject *QQmlComponentPrivate::beginCreate(QQmlRefPointer<QQmlContextData> conte
{
Q_Q(QQmlComponent);
auto cleanup = qScopeGuard([this] {
- if (!state.errors.isEmpty()) {
- for (const auto &e : qAsConst(state.errors))
+ if (!state.errors.isEmpty() && lcQmlComponentGeneral().isDebugEnabled()) {
+ for (const auto &e : qAsConst(state.errors)) {
qCDebug(lcQmlComponentGeneral) << "QQmlComponent: " << e.toString();
+ }
}
});
if (!context) {