diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 79c348ecc4d..66fa6da393e 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -43,6 +43,8 @@ #include #include +#include + using namespace QmlJSEditor; using namespace QmlJS; using namespace QmlJS::AST; @@ -625,13 +627,13 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const SemanticInfo &info) m_semanticMarks.removeAll(mark); delete mark; }; - for (const DiagnosticMessage &diagnostic : info.semanticMessages) { + for (const DiagnosticMessage &diagnostic : Utils::asConst(info.semanticMessages)) { auto mark = new QmlJSTextMark(q->filePath().toString(), diagnostic, onMarkRemoved); m_semanticMarks.append(mark); q->addMark(mark); } - for (const QmlJS::StaticAnalysis::Message &message : info.staticAnalysisMessages) { + for (const QmlJS::StaticAnalysis::Message &message : Utils::asConst(info.staticAnalysisMessages)) { auto mark = new QmlJSTextMark(q->filePath().toString(), message, onMarkRemoved); m_semanticMarks.append(mark);