summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp16
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;