diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-06-28 10:45:16 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-08-24 11:54:22 +0000 |
commit | 0a6315b7a2a00d56a101c4a2ea165242d356e024 (patch) | |
tree | c7b9a313f4e001d243d7b796129894b026a53be2 /src/location/maps/qgeoroutesegment_p.h | |
parent | 34ee76720ee09ac692ea149ce44413cb5c0c7b99 (diff) |
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/qgeoroutesegment_p.h')
-rw-r--r-- | src/location/maps/qgeoroutesegment_p.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/location/maps/qgeoroutesegment_p.h b/src/location/maps/qgeoroutesegment_p.h index f0b180da..d72f8b22 100644 --- a/src/location/maps/qgeoroutesegment_p.h +++ b/src/location/maps/qgeoroutesegment_p.h @@ -74,6 +74,9 @@ public: virtual bool valid() const; virtual void setValid(bool valid); + virtual bool isLegLastSegment() const; + virtual void setLegLastSegment(bool lastSegment); + virtual int travelTime() const; virtual void setTravelTime(int travelTime); @@ -90,6 +93,7 @@ public: virtual void setNextRouteSegment(const QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &next); QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> m_nextSegment; + static QGeoRouteSegmentPrivate *get(QGeoRouteSegment &segment); protected: virtual bool equals(const QGeoRouteSegmentPrivate &other) const; @@ -110,6 +114,9 @@ public: virtual bool valid() const override; virtual void setValid(bool valid) override; + virtual bool isLegLastSegment() const override; + virtual void setLegLastSegment(bool lastSegment) override; + virtual int travelTime() const override; virtual void setTravelTime(int travelTime) override; @@ -124,6 +131,7 @@ public: bool m_valid; + bool m_legLastSegment = false; int m_travelTime; qreal m_distance; QList<QGeoCoordinate> m_path; |