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 <fabian.kosmale@qt.io>
(cherry picked from commit 4741a7cd1c58dbb2adb85e7645ad552994b760ff)
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 539e123f0d
commit 4f3b16c491

View File

@ -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;