diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-08-27 12:22:14 +0200 |
---|---|---|
committer | paolo <paolo.angelelli@qt.io> | 2017-08-27 12:24:05 +0200 |
commit | 05703dd5271a2b25ee18dda6c136a5bee0f92629 (patch) | |
tree | 72668686841f3cc1df9384b90863e0eb175f53e6 /src/location/declarativemaps/qdeclarativegeomap.cpp | |
parent | b68b88373beb884c77ec9813cac1e9a79854b957 (diff) | |
parent | d22e6d09f1607e694694d2ae5b2f447605a8782e (diff) | |
download | qtlocation-05703dd5271a2b25ee18dda6c136a5bee0f92629.tar.gz |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h
Change-Id: I4940db79ebe500ff7e37ded42c7d29d7ccfb6253
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomap.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 37cfc303..9b19a0ac 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -553,26 +553,26 @@ QQuickGeoMapGestureArea *QDeclarativeGeoMap::gesture() */ void QDeclarativeGeoMap::populateMap() { - QObjectList kids = children(); - QList<QQuickItem *> quickKids = childItems(); - for (int i=0; i < quickKids.count(); ++i) - kids.append(quickKids.at(i)); + QSet<QObject *> kids = children().toSet(); + const QList<QQuickItem *> quickKids = childItems(); + for (QQuickItem *ite: quickKids) + kids.insert(ite); - for (int i = 0; i < kids.size(); ++i) { + for (QObject *k : qAsConst(kids)) { // dispatch items appropriately - QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(kids.at(i)); + QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(k); if (mapView) { m_mapViews.append(mapView); setupMapView(mapView); continue; } - QDeclarativeGeoMapItemBase *mapItem = qobject_cast<QDeclarativeGeoMapItemBase *>(kids.at(i)); + QDeclarativeGeoMapItemBase *mapItem = qobject_cast<QDeclarativeGeoMapItemBase *>(k); if (mapItem) { addMapItem(mapItem); continue; } // Allow to add to the map Map items contained inside a parent QQuickItem, but only those at one level of nesting. - QDeclarativeGeoMapItemGroup *itemGroup = qobject_cast<QDeclarativeGeoMapItemGroup *>(kids.at(i)); + QDeclarativeGeoMapItemGroup *itemGroup = qobject_cast<QDeclarativeGeoMapItemGroup *>(k); if (itemGroup) { addMapItemGroup(itemGroup); continue; |