summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeoroute.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-06-28 10:45:16 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-08-24 11:54:22 +0000
commit0a6315b7a2a00d56a101c4a2ea165242d356e024 (patch)
treec7b9a313f4e001d243d7b796129894b026a53be2 /src/location/maps/qgeoroute.h
parent34ee76720ee09ac692ea149ce44413cb5c0c7b99 (diff)
downloadqtlocation-0a6315b7a2a00d56a101c4a2ea165242d356e024.tar.gz
Add support for route legs
This patch adds support for route legs, that are the portions of a route between one waypoint and the next. QGeoRouteLeg in particular can be seen as an API addition to QGeoRoute in that it uses and exposes additional methods added to QGeoRoutePrivate but not used in QGeoRoute. Currently the request for legs is set to be the same as the request for the entire route. Finding the related bounding waypoints has to be done programmatically using the legIndex property. Change-Id: If462b1dc6348be16dc96b167db5500f079fe0a64 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeoroute.h')
-rw-r--r--src/location/maps/qgeoroute.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h
index ef1f7566..381152e3 100644
--- a/src/location/maps/qgeoroute.h
+++ b/src/location/maps/qgeoroute.h
@@ -50,13 +50,13 @@ class QGeoRectangle;
class QGeoRouteSegment;
class QGeoRoutePrivate;
-
+class QGeoRouteLeg;
class Q_LOCATION_EXPORT QGeoRoute
{
public:
QGeoRoute();
QGeoRoute(const QGeoRoute &other);
- ~QGeoRoute();
+ ~QGeoRoute(); // ### Qt6: make this virtual
QGeoRoute &operator = (const QGeoRoute &other);
@@ -87,9 +87,13 @@ public:
void setPath(const QList<QGeoCoordinate> &path);
QList<QGeoCoordinate> path() const;
+ void setRouteLegs(const QList<QGeoRouteLeg> &legs);
+ QList<QGeoRouteLeg> routeLegs() const;
+
protected:
QGeoRoute(const QExplicitlySharedDataPointer<QGeoRoutePrivate> &dd);
QExplicitlySharedDataPointer<QGeoRoutePrivate> &d();
+ const QExplicitlySharedDataPointer<QGeoRoutePrivate> &const_d() const;
private:
QExplicitlySharedDataPointer<QGeoRoutePrivate> d_ptr;
@@ -97,6 +101,26 @@ private:
friend class QGeoRoutePrivate;
};
+class Q_LOCATION_EXPORT QGeoRouteLeg: public QGeoRoute
+{
+public:
+ QGeoRouteLeg();
+ QGeoRouteLeg(const QGeoRouteLeg &other);
+ ~QGeoRouteLeg();
+
+ void setLegIndex(int idx);
+ int legIndex() const;
+
+ void setOverallRoute(const QGeoRoute &route);
+ QGeoRoute overallRoute() const;
+
+protected:
+ QGeoRouteLeg(const QExplicitlySharedDataPointer<QGeoRoutePrivate> &dd);
+
+ friend class QDeclarativeGeoRoute;
+ friend class QGeoRoutePrivate;
+};
+
QT_END_NAMESPACE
#endif