QmlJsEditor: Remove foreach / Q_FOREACH usage

Task-number: QTCREATORBUG-27464
Change-Id: I77741a639d8585d1e0ad04d7c5e6588852202e4a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Artem Sokolovskii
2022-05-17 16:11:03 +02:00
parent 840263eb9a
commit 54d4c4db62
11 changed files with 69 additions and 58 deletions

View File

@@ -129,20 +129,20 @@ void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::P
if (scopeChain && scopeObject) {
m_prototypes.clear();
foreach (const ObjectValue *object,
PrototypeIterator(scopeObject, scopeChain->context()).all()) {
const QList<const ObjectValue *> objects
= PrototypeIterator(scopeObject, scopeChain->context()).all();
for (const ObjectValue *object : objects)
m_prototypes.append(object->className());
}
if (m_prototypes.contains(QLatin1String("PropertyChanges"))) {
isPropertyChanges = true;
const ObjectValue *targetObject = getPropertyChangesTarget(node, *scopeChain);
m_prototypes.clear();
if (targetObject) {
foreach (const ObjectValue *object,
PrototypeIterator(targetObject, scopeChain->context()).all()) {
const QList<const ObjectValue *> objects
= PrototypeIterator(targetObject, scopeChain->context()).all();
for (const ObjectValue *object : objects)
m_prototypes.append(object->className());
}
}
}
}