diff options
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeocodemodel.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeocodemodel.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp index e44d6aaa..c80323bd 100644 --- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp @@ -506,10 +506,8 @@ void QDeclarativeGeocodeModel::setLocations(const QList<QGeoLocation> &locations beginResetModel(); qDeleteAll(declarativeLocations_); declarativeLocations_.clear(); - for (int i = 0; i < locations.count(); ++i) { - QDeclarativeGeoLocation *location = new QDeclarativeGeoLocation(locations.at(i), this); - declarativeLocations_.append(location); - } + for (const auto &location : locations) + declarativeLocations_.append(new QDeclarativeGeoLocation(location, this)); endResetModel(); } |