diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2026-04-27 17:57:01 +0200 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2026-04-28 22:48:41 +0000 |
| commit | 91362e7a08b536f6467cfa718097ca4e554e40b7 (patch) | |
| tree | acf5c34bb41a3c898431240866381cb138491798 | |
| parent | d975564bc75252db16f8d5f9af0912b5c392db95 (diff) | |
Use const references when iterating
We don't want to copy the elements.
Pick-to: 6.8
Task-number: QTBUG-146040
Axivion-Id: qt_Essentials_qtqml_dev_linux:SV289
Axivion-Id: qt_Essentials_qtqml_dev_linux:SV696
Change-Id: Ia72bd0577b704e5310850218eeb6e8ab3d75df81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b053d7ab99129d6b77920d17ccf75eacf218bb29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| -rw-r--r-- | src/qml/debugger/qqmldebugconnector.cpp | 2 | ||||
| -rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp index 79d1c01bf4..212bf3e3ba 100644 --- a/src/qml/debugger/qqmldebugconnector.cpp +++ b/src/qml/debugger/qqmldebugconnector.cpp @@ -113,7 +113,7 @@ QQmlDebugConnector *QQmlDebugConnector::instance() for (const QPluginParsedMetaData &md : metaData) { const auto keys = md.value(QtPluginMetaDataKeys::MetaData).toMap() .value(QLatin1String("Keys")).toArray(); - for (const QCborValue key : keys) { + for (const QCborValue &key : keys) { QString keyString = key.toString(); if (params->services.isEmpty() || params->services.contains(keyString)) loadQQmlDebugService(keyString); diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 749408bb75..38f024a2c9 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1874,7 +1874,7 @@ QQmlError QQmlComponentPrivate::unsetRequiredPropertyToQQmlError(const RequiredP } default: description += QLatin1String("\nIt can be set via one of the following alias properties:"); - for (auto aliasInfo: unsetRequiredProperty.aliasesToRequired) { + for (const auto &aliasInfo: unsetRequiredProperty.aliasesToRequired) { description += QLatin1String("\n- %1 (%2)").arg(aliasInfo.propertyName, aliasInfo.fileUrl.toString()); } description += QLatin1Char('\n'); |
