Debugger: Use qAsConst with non-const Qt containers in range-loops

Change-Id: I7bd27f8317b62fe448e037d5a25e78b4c88c648d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2021-02-16 23:09:02 +01:00
parent dfa24f09ad
commit b3686d410d
6 changed files with 9 additions and 9 deletions

View File

@@ -268,7 +268,7 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
m_rootContexts.insert(engineId, qvariant_cast<ContextReference>(value));
if (m_rootContexts.size() == m_engines.size()) {
clearObjectTree();
for (const auto &engine : m_engines) {
for (const auto &engine : qAsConst(m_engines)) {
QString name = engine.name();
if (name.isEmpty())
name = QString::fromLatin1("Engine %1").arg(engine.debugId());
@@ -445,7 +445,7 @@ void QmlInspectorAgent::verifyAndInsertObjectInTree(const ObjectReference &objec
// Still not found? Maybe we're loading the engine itself.
if (engineId == -1) {
for (const auto &engine : m_engines) {
for (const auto &engine : qAsConst(m_engines)) {
if (engine.debugId() == objectDebugId) {
engineId = engine.debugId();
break;