summaryrefslogtreecommitdiff
path: root/src/location/maps
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2019-02-05 19:42:22 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2019-02-06 11:54:12 +0000
commitad7bcebc575922fc7c5654c118794e5758d347d2 (patch)
tree022f156d3e3859b1d488e3ec8cbdfb7b89a1a699 /src/location/maps
parent7a65e5f2b9d5ecda418e76f98acd90506025186a (diff)
downloadqtlocation-ad7bcebc575922fc7c5654c118794e5758d347d2.tar.gz
Add departure time attribute to route queriesv5.13.0-alpha1
So that it can be used to improve the route calculation based on traffic information or other time-based information (ferries etc.) Change-Id: I8bdc81046484cc4f0ebfaffbdf6f034c555d7781 Fixes: QTBUG-70503 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/location/maps')
-rw-r--r--src/location/maps/qgeorouterequest.cpp24
-rw-r--r--src/location/maps/qgeorouterequest.h4
-rw-r--r--src/location/maps/qgeorouterequest_p.h1
3 files changed, 29 insertions, 0 deletions
diff --git a/src/location/maps/qgeorouterequest.cpp b/src/location/maps/qgeorouterequest.cpp
index 57fbe207..412dc598 100644
--- a/src/location/maps/qgeorouterequest.cpp
+++ b/src/location/maps/qgeorouterequest.cpp
@@ -469,6 +469,30 @@ QGeoRouteRequest::ManeuverDetail QGeoRouteRequest::maneuverDetail() const
}
/*!
+ Sets the departure time for the route calculation. This information can be used by
+ the backend to calculate a faster route, for example by avoiding blockages present at
+ given points in time.
+
+ The default value is an invalid \l QDateTime
+
+ \since 5.13
+*/
+void QGeoRouteRequest::setDepartureTime(const QDateTime &departureTime)
+{
+ d_ptr->departureTime = departureTime;
+}
+
+/*!
+ Returns the departure time in the request.
+
+ \since 5.13
+*/
+QDateTime QGeoRouteRequest::departureTime() const
+{
+ return d_ptr->departureTime;
+}
+
+/*!
Sets the extra parameters \a extraParameters for the route request.
The format of the extra parameters is plugin specific, and documented per plugin.
diff --git a/src/location/maps/qgeorouterequest.h b/src/location/maps/qgeorouterequest.h
index 5a4bc61e..52057ce0 100644
--- a/src/location/maps/qgeorouterequest.h
+++ b/src/location/maps/qgeorouterequest.h
@@ -149,6 +149,10 @@ public:
void setManeuverDetail(ManeuverDetail maneuverDetail);
ManeuverDetail maneuverDetail() const;
+ // defaults to invalid datetime
+ void setDepartureTime(const QDateTime &departureTime);
+ QDateTime departureTime() const;
+
void setExtraParameters(const QVariantMap &extraParameters);
QVariantMap extraParameters() const;
diff --git a/src/location/maps/qgeorouterequest_p.h b/src/location/maps/qgeorouterequest_p.h
index df0cd62c..71c8b58b 100644
--- a/src/location/maps/qgeorouterequest_p.h
+++ b/src/location/maps/qgeorouterequest_p.h
@@ -77,6 +77,7 @@ public:
QGeoRouteRequest::RouteOptimizations routeOptimization;
QGeoRouteRequest::SegmentDetail segmentDetail;
QGeoRouteRequest::ManeuverDetail maneuverDetail;
+ QDateTime departureTime;
QVariantMap extraParameters;
};