diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-12-07 12:01:42 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-23 18:49:05 +0000 |
commit | 34e4a8ef6d20e829a322bfef1d09136a37fecfd2 (patch) | |
tree | f4bfd10d8a155f14a7f88f881bb2768fc87abadc /examples/widgets/animation/sub-attaq/torpedo.cpp | |
parent | 26f7edb09eaf66590de9a3603489464fd868eedc (diff) |
Cleanup Widgets examples - foreach
Cleanup the Widgets examples - replace foreach with range-based for loop
in the remaining directories
Change-Id: I321e6c0f414401a1ae4fb65762b97d894b725afa
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Diffstat (limited to 'examples/widgets/animation/sub-attaq/torpedo.cpp')
-rw-r--r-- | examples/widgets/animation/sub-attaq/torpedo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/widgets/animation/sub-attaq/torpedo.cpp b/examples/widgets/animation/sub-attaq/torpedo.cpp index 5f8ef2f2b8..92a3833452 100644 --- a/examples/widgets/animation/sub-attaq/torpedo.cpp +++ b/examples/widgets/animation/sub-attaq/torpedo.cpp @@ -111,7 +111,9 @@ void Torpedo::setCurrentSpeed(int speed) void Torpedo::onAnimationLaunchValueChanged(const QVariant &) { - foreach (QGraphicsItem *item , collidingItems(Qt::IntersectsItemBoundingRect)) { + const QList<QGraphicsItem *> colItems = + collidingItems(Qt::IntersectsItemBoundingRect); + for (QGraphicsItem *item : colItems) { if (Boat *b = qgraphicsitem_cast<Boat*>(item)) b->destroy(); } |