diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-11-19 13:43:58 +0300 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-11-24 19:04:25 +0000 |
commit | 9757970c477fbd5c81a603b0a5d2106e6db7ca34 (patch) | |
tree | 4452a5160a65e61d36e2440b3d9f8c8a9d59329d /examples | |
parent | b0b50c510024f201ec9fed233659ad1f0cfda684 (diff) |
Replace 'foreach' macro with range-based 'for'
Change-Id: I34479bc9673d0202363aeba5c7919efc8f0d7287
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/collidingmice/mouse.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/collidingmice/mouse.cpp b/examples/collidingmice/mouse.cpp index c3373501c..8dbe28c49 100644 --- a/examples/collidingmice/mouse.cpp +++ b/examples/collidingmice/mouse.cpp @@ -162,11 +162,11 @@ void Mouse::advance(int step) // Try not to crash with any other mice //! [7] - QList<QGraphicsItem *> dangerMice = scene()->items(QPolygonF() + const QList<QGraphicsItem *> dangerMice = scene()->items(QPolygonF() << mapToScene(0, 0) << mapToScene(-30, -50) << mapToScene(30, -50)); - foreach (QGraphicsItem *item, dangerMice) { + for (QGraphicsItem *item : dangerMice) { if (item == this) continue; |