summaryrefslogtreecommitdiff
path: root/src/location/labs/qdeclarativenavigator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/labs/qdeclarativenavigator.cpp')
-rw-r--r--src/location/labs/qdeclarativenavigator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/location/labs/qdeclarativenavigator.cpp b/src/location/labs/qdeclarativenavigator.cpp
index d4374719..ffc6c454 100644
--- a/src/location/labs/qdeclarativenavigator.cpp
+++ b/src/location/labs/qdeclarativenavigator.cpp
@@ -761,10 +761,10 @@ void QDeclarativeNavigationBasicDirections::onAlternativeRoutesChanged()
{
const QList<QGeoRoute> &routes = m_navigatorPrivate->m_navigator->alternativeRoutes();
QList<QDeclarativeGeoRoute *> declarativeRoutes;
- for (int i = 0; i < routes.size(); ++i) {
- QDeclarativeGeoRoute *route = new QDeclarativeGeoRoute(routes.at(i), &m_routes);
- QQmlEngine::setContextForObject(route, QQmlEngine::contextForObject(this));
- declarativeRoutes.append(route);
+ for (const auto &route : routes) {
+ QDeclarativeGeoRoute *declroute = new QDeclarativeGeoRoute(route, &m_routes);
+ QQmlEngine::setContextForObject(declroute, QQmlEngine::contextForObject(this));
+ declarativeRoutes.append(declroute);
}
m_routes.updateData(declarativeRoutes);
}