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
Pick-to: 6.6 6.5
Change-Id: I033e3725df95b29a8ef295c4e74d746d83234835
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-08-07 14:42:55 +02:00
parent d67aa6291d
commit 4741a7cd1c

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;