From 9887252d14ce29a9c6d91355bde24f2e80564919 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 7 Aug 2023 14:42:55 +0200 Subject: [PATCH] tst_QWizard: port away from Q_FOREACH[1/5]: TestWizard::applyOperations() This function is called only from one test function. Mark the function's argument as const in the caller, bringing this use into the const-local category, which is implicitly safe to port 1:1 to ranged-for. Task-number: QTBUG-115803 Change-Id: I9145c1ae2aed5ab3cafc4947dc3eaaf9a27c6a04 Reviewed-by: Fabian Kosmale (cherry picked from commit 88464f7e9388f7a2df096ebb8b02026d0b229f15) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index 8739a012773..533bae400ca 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -1794,7 +1794,7 @@ public: void applyOperations(const QList> &operations) { - foreach (const QSharedPointer &op, operations) { + for (const QSharedPointer &op : operations) { if (op) { op->apply(this); opsDescr += QLatin1Char('(') + op->describe() + QLatin1String(") "); @@ -2044,7 +2044,7 @@ void tst_QWizard::combinations() { QFETCH(bool, ref); QFETCH(bool, testEquality); - QFETCH(QList>, operations); + QFETCH(const QList>, operations); TestWizard wizard; #if !defined(QT_NO_STYLE_WINDOWSVISTA)