diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-08-07 14:42:55 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-08-07 23:56:10 +0200 |
commit | d67aa6291d62300567ae0b99806941eda683fe46 (patch) | |
tree | 7d7de343f9de6ebb0c7f8afd728323bc76aa2162 /tests/auto/widgets/dialogs | |
parent | d0a4b29132c2d03e3f379d098a6fee4dba0a7ac4 (diff) |
tst_QWizard: port away from Q_FOREACH[3/5]: OptionInfo ctor
This is iterating over the keys() of a member container we've just
filled in the same function. The loop body clearly doesn't modify the
container being iterated over. Port to the future-proof ranged
for-loop over asKeyValueRange(), using the _-in-SB pattern Christian
Ehrlicher showed me to indicate we're not interested in the value.
Task-number: QTBUG-115803
Pick-to: 6.6 6.5
Change-Id: I3d86a1de9ea460b7d57fa421ea76e41d2c122f43
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r-- | tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index b47321da74..977d46fbe0 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -1642,7 +1642,7 @@ class OptionInfo for (int i = 0; i < 2; ++i) { QMap<QWizard::WizardOption, QSharedPointer<Operation> > operations_; - foreach (QWizard::WizardOption option, tags.keys()) + for (const auto &[option, _] : std::as_const(tags).asKeyValueRange()) operations_[option] = SetOption::create(option, i == 1); operations << operations_; } |