diff options
Diffstat (limited to 'src/location/declarativemaps')
5 files changed, 10 insertions, 10 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index d239934b..ef537112 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -311,7 +311,7 @@ void QDeclarativeGeoMap::onSupportedMapTypesChanged() m_map->setActiveMapType(QGeoMapType()); // no supported map types: setting an invalid one } else { bool hasMapType = false; - foreach (QDeclarativeGeoMapType *declarativeType, m_supportedMapTypes) { + for (auto *declarativeType : m_supportedMapTypes) { if (declarativeType->mapType() == m_map->activeMapType()) hasMapType = true; } @@ -1972,7 +1972,7 @@ QList<QGeoMapObject *> QDeclarativeGeoMap::mapObjects() QList<QObject *> QDeclarativeGeoMap::mapItems() { QList<QObject *> ret; - foreach (const QPointer<QDeclarativeGeoMapItemBase> &ptr, m_mapItems) { + for (const auto &ptr : m_mapItems) { if (ptr) ret << ptr.data(); } diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp index 8362940e..93e29242 100644 --- a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp @@ -102,10 +102,10 @@ QDeclarativeGeoMapItemBase::~QDeclarativeGeoMapItemBase() */ void QDeclarativeGeoMapItemBase::afterChildrenChanged() { - QList<QQuickItem *> kids = childItems(); + const QList<QQuickItem *> kids = childItems(); if (kids.size() > 0) { bool printedWarning = false; - foreach (QQuickItem *i, kids) { + for (auto *i : kids) { if (i->flags() & QQuickItem::ItemHasContents && !qobject_cast<QQuickMouseArea *>(i)) { if (!printedWarning) { diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp index 7dc934bf..6ef081f4 100644 --- a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp @@ -282,10 +282,10 @@ QQuickItem *QDeclarativeGeoMapQuickItem::sourceItem() */ void QDeclarativeGeoMapQuickItem::afterChildrenChanged() { - QList<QQuickItem *> kids = childItems(); + const QList<QQuickItem *> kids = childItems(); if (kids.size() > 0) { bool printedWarning = false; - foreach (QQuickItem *i, kids) { + for (auto *i : kids) { if (i->flags() & QQuickItem::ItemHasContents && !qobject_cast<QQuickMouseArea *>(i) && sourceItem_.data() != i diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp index 239b0f50..ab4851c0 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp @@ -202,7 +202,7 @@ void QDeclarativeGeoServiceProvider::componentComplete() QStringList providers = QGeoServiceProvider::availableServiceProviders(); /* first check any preferred plugins */ - foreach (const QString &name, prefer_) { + for (const QString &name : prefer_) { if (providers.contains(name)) { // so we don't try it again later providers.removeAll(name); @@ -216,7 +216,7 @@ void QDeclarativeGeoServiceProvider::componentComplete() } /* then try the rest */ - foreach (const QString &name, providers) { + for (const QString &name : qAsConst(providers)) { QGeoServiceProvider sp(name, parameterMap(), experimental_); if (required_->matches(&sp)) { setName(name); 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()); } |