diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-02-29 01:01:50 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-05-14 16:02:31 +0000 |
commit | 6cbe56dfec652d24678aeec069a22f95eb83aa2b (patch) | |
tree | c6d1d828ef858d050aa71d07366d450ebda85f9b /src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp | |
parent | afc5426d4a1b22df72e4cf5582c390d774768673 (diff) |
quick3d: eradicate Q_FOREACH loops [low-risk]
... by replacing them with C++11 range-for loops.
This is the batch with low-risk changes. They operate
on local containers or the loop body clearly does not
cause the container to change.
Sprinkled in a reserve() or two.
Change-Id: I5a3da485213791ae58c82f4a81829cfba558a3d6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp')
-rw-r--r-- | src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp b/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp index 93310fd4d..72be7e7ac 100644 --- a/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp +++ b/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp @@ -89,7 +89,8 @@ int Quick3DLogicalDevice::axesCount(QQmlListProperty<QAxis> *list) void Quick3DLogicalDevice::clearAxes(QQmlListProperty<QAxis> *list) { Quick3DLogicalDevice *device = qobject_cast<Quick3DLogicalDevice *>(list->object); - Q_FOREACH (QAxis *axis, device->parentLogicalDevice()->axes()) + const auto axes = device->parentLogicalDevice()->axes(); + for (QAxis *axis : axes) device->parentLogicalDevice()->removeAxis(axis); } @@ -114,7 +115,8 @@ int Quick3DLogicalDevice::actionCount(QQmlListProperty<QAction> *list) void Quick3DLogicalDevice::clearActions(QQmlListProperty<QAction> *list) { Quick3DLogicalDevice *device = qobject_cast<Quick3DLogicalDevice *>(list->object); - Q_FOREACH (QAction *action, device->parentLogicalDevice()->actions()) + const auto actions = device->parentLogicalDevice()->actions(); + for (QAction *action : actions) device->parentLogicalDevice()->removeAction(action); } |