summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-04 21:33:19 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-15 14:40:44 +0200
commit6af3cc27235a67420d32dbe0146d94ada6b25028 (patch)
tree8335be4a6f973aa80de3d9be9195d55ca0f44f48 /src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
parenta6c48812eff4e1aa9b05ea4b811de357242c5588 (diff)
downloadqtlocation-6af3cc27235a67420d32dbe0146d94ada6b25028.tar.gz
Use QVariant support for converting to a QGeoCoordinate
This gets rid of the rest of the locationvaluetypehelper usages, so those files can go completely now. Change-Id: Ieaa543578ef35a8887c04c24352e72ba931badb9 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeoroutemodel.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
index 64595ef2..99dae3a3 100644
--- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
@@ -40,7 +40,6 @@
#include "qdeclarativegeoroutemodel_p.h"
#include "qdeclarativegeoroute_p.h"
#include "error_messages_p.h"
-#include "locationvaluetypehelper_p.h"
#include <QtCore/QCoreApplication>
#include <QtQml/QQmlEngine>
@@ -909,7 +908,7 @@ void QDeclarativeGeoRouteQuery::setWaypoints(const QVariantList &value)
// if here, w is not a Waypoint, so either a QGeoCoordinate or a variant map, so a waypoint has to be instantiated.
allWaypoints = false;
- QGeoCoordinate c = parseCoordinate(w);
+ const QGeoCoordinate c = w.value<QGeoCoordinate>();
if (!c.isValid()) {
qmlWarning(this) << QStringLiteral("Invalid waypoint");
flushWaypoints(waypointList);
@@ -1073,7 +1072,7 @@ void QDeclarativeGeoRouteQuery::addWaypoint(const QVariant &waypoint)
// if here, waypoint is not a Waypoint, so either a QGeoCoordinate or a variant map, so a waypoint has to be instantiated.
- QGeoCoordinate c = parseCoordinate(waypoint);
+ const QGeoCoordinate c = waypoint.value<QGeoCoordinate>();
if (!c.isValid()) {
qmlWarning(this) << QStringLiteral("Invalid coordinate as waypoint");
return;
@@ -1121,7 +1120,7 @@ void QDeclarativeGeoRouteQuery::removeWaypoint(const QVariant &waypoint)
return;
}
- QGeoCoordinate c = parseCoordinate(waypoint);
+ const QGeoCoordinate c = waypoint.value<QGeoCoordinate>();
if (!c.isValid()) {
qmlWarning(this) << QStringLiteral("Invalid coordinate as waypoint");
return;