diff options
author | Tasuku Suzuki <tasuku.suzuki@qbc.io> | 2018-12-11 15:21:35 +0900 |
---|---|---|
committer | Tasuku Suzuki <tasuku.suzuki@qbc.io> | 2018-12-26 16:51:09 +0000 |
commit | 1e24cec7e3ebf5f62f5440d848caf6cd9db1e456 (patch) | |
tree | 936c0824a2495a23e780d142f0de289cbe43bd6e /src/location/maps/qgeorouteparser_p.h | |
parent | 100e0416e7faff954221df9ef97920ba512712c0 (diff) | |
download | qtlocation-1e24cec7e3ebf5f62f5440d848caf6cd9db1e456.tar.gz |
Introduce a map plugin parameter to decide U-Turn direction
When "uturn" comes from OSRM, Qt returns UTurnLeft since Right Hand
Traffic is in use in most countries.
This commit allows qml to set traffic side to return correct u-turn
direction.
Task-number: QTBUG-72462
Change-Id: Ifaa002b063159b4e4ee563d007721ba7a4a587a4
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/location/maps/qgeorouteparser_p.h')
-rw-r--r-- | src/location/maps/qgeorouteparser_p.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/location/maps/qgeorouteparser_p.h b/src/location/maps/qgeorouteparser_p.h index 33c3a4db..053dadb1 100644 --- a/src/location/maps/qgeorouteparser_p.h +++ b/src/location/maps/qgeorouteparser_p.h @@ -61,12 +61,25 @@ class Q_LOCATION_PRIVATE_EXPORT QGeoRouteParser : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QGeoRouteParser) - + Q_PROPERTY(TrafficSide trafficSide READ trafficSide WRITE setTrafficSide NOTIFY trafficSideChanged) + Q_ENUMS(TrafficSide) public: + enum TrafficSide { + RightHandTraffic, + LeftHandTraffic + }; virtual ~QGeoRouteParser(); QGeoRouteReply::Error parseReply(QList<QGeoRoute> &routes, QString &errorString, const QByteArray &reply) const; QUrl requestUrl(const QGeoRouteRequest &request, const QString &prefix) const; + TrafficSide trafficSide() const; + +public Q_SLOTS: + void setTrafficSide(TrafficSide trafficSide); + +Q_SIGNALS: + void trafficSideChanged(TrafficSide trafficSide); + protected: QGeoRouteParser(QGeoRouteParserPrivate &dd, QObject *parent = nullptr); |