summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qgeomapitemgeometry.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-07-24 12:39:01 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-07-26 08:34:51 +0000
commitda870b829cc860ca394af836733dbcc002016061 (patch)
treef9e1dc0774f43b2f621eac7654ec139ab00ba285 /src/location/declarativemaps/qgeomapitemgeometry.cpp
parent7c00aa7aa1476fc45adc5abf54185545ecc4c14e (diff)
downloadqtlocation-da870b829cc860ca394af836733dbcc002016061.tar.gz
Replace foreach with ranged for and set QT_NO_FOREACH
Make containers const where they obviously should be, iterate over references where it's clearly possible. Cherry-pick of 2c8c5dca44aba5612cc67b04dd3c7e5fc4919b19. Change-Id: Ie55a58873b48bbb60ac49790db612f85777e6ceb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qgeomapitemgeometry.cpp')
-rw-r--r--src/location/declarativemaps/qgeomapitemgeometry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qgeomapitemgeometry.cpp b/src/location/declarativemaps/qgeomapitemgeometry.cpp
index 9fe92287..ed96faa7 100644
--- a/src/location/declarativemaps/qgeomapitemgeometry.cpp
+++ b/src/location/declarativemaps/qgeomapitemgeometry.cpp
@@ -108,14 +108,14 @@ QRectF QGeoMapItemGeometry::translateToCommonOrigin(const QList<QGeoMapItemGeome
// first get max offset
QPointF maxOffset = geoms.at(0)->firstPointOffset();
- foreach (QGeoMapItemGeometry *g, geoms) {
+ for (const QGeoMapItemGeometry *g : geoms) {
QPointF o = g->firstPointOffset();
maxOffset.setX(qMax(o.x(), maxOffset.x()));
maxOffset.setY(qMax(o.y(), maxOffset.y()));
}
// then translate everything
- foreach (QGeoMapItemGeometry *g, geoms) {
+ for (QGeoMapItemGeometry *g : geoms) {
g->translate(maxOffset - g->firstPointOffset());
brects.addRect(g->sourceBoundingBox());
}