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 <fabian.kosmale@qt.io>
(cherry picked from commit 88464f7e9388f7a2df096ebb8b02026d0b229f15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-08-07 14:42:55 +02:00 committed by Qt Cherry-pick Bot
parent 1f664fe9cf
commit 9887252d14

View File

@ -1794,7 +1794,7 @@ public:
void applyOperations(const QList<QSharedPointer<Operation>> &operations)
{
foreach (const QSharedPointer<Operation> &op, operations) {
for (const QSharedPointer<Operation> &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<QSharedPointer<Operation>>, operations);
QFETCH(const QList<QSharedPointer<Operation>>, operations);
TestWizard wizard;
#if !defined(QT_NO_STYLE_WINDOWSVISTA)