forked from qt-creator/qt-creator
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:
@@ -268,15 +268,17 @@ void QmlJSHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos, R
|
||||
|
||||
bool QmlJSHoverHandler::matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos)
|
||||
{
|
||||
foreach (const QTextEdit::ExtraSelection &sel,
|
||||
qmlEditor->extraSelections(TextEditorWidget::CodeWarningsSelection)) {
|
||||
const QList<QTextEdit::ExtraSelection> selections =
|
||||
qmlEditor->extraSelections(TextEditorWidget::CodeWarningsSelection);
|
||||
for (const QTextEdit::ExtraSelection &sel : selections) {
|
||||
if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) {
|
||||
setToolTip(sel.format.toolTip());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
foreach (const QTextLayout::FormatRange &range,
|
||||
qmlEditor->qmlJsEditorDocument()->diagnosticRanges()) {
|
||||
const QVector<QTextLayout::FormatRange> ranges =
|
||||
qmlEditor->qmlJsEditorDocument()->diagnosticRanges();
|
||||
for (const QTextLayout::FormatRange &range : ranges) {
|
||||
if (pos >= range.start && pos < range.start+range.length) {
|
||||
setToolTip(range.format.toolTip());
|
||||
return true;
|
||||
@@ -357,7 +359,8 @@ void QmlJSHoverHandler::handleImport(const ScopeChain &scopeChain, AST::UiImport
|
||||
if (!imports)
|
||||
return;
|
||||
|
||||
foreach (const Import &import, imports->all()) {
|
||||
const QList<Import> importList = imports->all();
|
||||
for (const Import &import : importList) {
|
||||
if (import.info.ast() == node) {
|
||||
if (import.info.type() == ImportType::Library
|
||||
&& !import.libraryPath.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user