diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-04-08 00:09:32 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-04-11 15:39:13 +0000 |
commit | 892bd9301dadf4016705daa4812c5c9d0193fb92 (patch) | |
tree | 8b1601a856cadae12b35df1eecb4e2f7d316934f /src/location/declarativemaps/qdeclarativegeomap.cpp | |
parent | 48c17c80b9bb003ff92150d6ca8a54109b987715 (diff) | |
download | qtlocation-892bd9301dadf4016705daa4812c5c9d0193fb92.tar.gz |
Prevent QList detaching in for loops in QDeclarativeGeoMap
Using qAsConst where possible to prevent QList from detaching.
Change-Id: Ief03fb17761e350335f945b7134cf4a9266971d7
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomap.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 35520227..81ef49ef 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -791,7 +791,7 @@ void QDeclarativeGeoMap::mappingManagerInitialized() // Any map items that were added before the plugin was ready // need to have setMap called again - foreach (const QPointer<QDeclarativeGeoMapItemBase> &item, m_mapItems) { + for (const QPointer<QDeclarativeGeoMapItemBase> &item : qAsConst(m_mapItems)) { if (item) { item->setMap(this, m_map); m_map->addMapItem(item.data()); // m_map filters out what is not supported. @@ -811,7 +811,7 @@ void QDeclarativeGeoMap::mappingManagerInitialized() // All map parameters that were added before the plugin was ready // need to be added to m_map - for (QDeclarativeGeoMapParameter *p : m_mapParameters) + for (QDeclarativeGeoMapParameter *p : qAsConst(m_mapParameters)) m_map->addParameter(p); if (m_initialized) @@ -1702,7 +1702,7 @@ void QDeclarativeGeoMap::clearMapParameters() QList<QObject *> QDeclarativeGeoMap::mapParameters() { QList<QObject *> ret; - for (QDeclarativeGeoMapParameter *p : m_mapParameters) + for (QDeclarativeGeoMapParameter *p : qAsConst(m_mapParameters)) ret << p; return ret; } |