From 4f3b16c491141d23c0118fb0265a1a0a17141300 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[4/5]: TestWizard dtor This is iterating over a data member container that's otherwise only touched in the constructor of the same object. The only reason why it's not a const is that the initialization from QWizard::addPage() makes that very cumbersome. So port to a ranged for-loop and apply std::as_const(). Task-number: QTBUG-115803 Change-Id: I033e3725df95b29a8ef295c4e74d746d83234835 Reviewed-by: Fabian Kosmale (cherry picked from commit 4741a7cd1c58dbb2adb85e7645ad552994b760ff) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index 977d46fbe03..d4d36bb84f6 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -1785,7 +1785,7 @@ public: ~TestWizard() { - foreach (int id, pageIds) { + for (int id : std::as_const(pageIds)) { QWizardPage *page_to_delete = page(id); removePage(id); delete page_to_delete;