7#include <QtCore/QCoreApplication>
8#include <QtQml/QQmlEngine>
9#include <QtQml/qqmlinfo.h>
10#include <QtLocation/QGeoRoutingManager>
11#include <QtPositioning/QGeoRectangle>
97 return routes_.
count();
149 if (index < 0 || index >= routes_.
count()) {
173 return routes_.
count();
181 if (!
index.isValid()) {
234 this, &QDeclarativeGeoRouteModel::pluginReady);
241void QDeclarativeGeoRouteModel::pluginReady()
265 if (!routingManager) {
271 this, &QDeclarativeGeoRouteModel::routingFinished);
273 this, &QDeclarativeGeoRouteModel::routingError);
279void QDeclarativeGeoRouteModel::queryDetailsChanged()
281 if (autoUpdate_ && complete_)
314 this, &QDeclarativeGeoRouteModel::queryDetailsChanged);
382 if (!serviceProvider)
402 if (!serviceProvider) {
403 if (plugin_->
locales().isEmpty())
410 if (!routingManager) {
411 if (plugin_->
locales().isEmpty())
491void QDeclarativeGeoRouteModel::setError(RouteError
error,
const QString& errorString)
518 if (!serviceProvider)
522 if (!routingManager) {
527 setError(
ParseError,
tr(
"Cannot route, valid query not set."));
532 if (
request.waypoints().count() < 2) {
533 setError(
ParseError,
tr(
"Not enough waypoints for routing."));
545 routingFinished(
reply);
564 const int oldCount = routes_.
count();
565 routes_ =
reply->routes();
571 if (oldCount != 0 || routes_.
count() != 0)
573 if (oldCount != routes_.
count())
745 if (m_waypoints ==
value)
876 m_waypoints << waypoint;
1010 QGeoRouteRequest::TravelModes reqTravelModes;
1121 QGeoRouteRequest::TravelModes reqTravelModes = request_.
travelModes();
1122 QDeclarativeGeoRouteQuery::TravelModes
travelModes;
1162 QGeoRouteRequest::RouteOptimizations reqOptimizations = request_.
routeOptimization();
1163 QDeclarativeGeoRouteQuery::RouteOptimizations optimization;
1174 return optimization;
1204 QGeoRouteRequest::RouteOptimizations reqOptimizations;
1231 if (m_waypointsChanged) {
1232 m_waypointsChanged =
false;
1239void QDeclarativeGeoRouteQuery::excludedAreaCoordinateChanged()
1241 if (!m_excludedAreaCoordinateChanged) {
1242 m_excludedAreaCoordinateChanged =
true;
1247void QDeclarativeGeoRouteQuery::waypointChanged()
1249 m_waypointsChanged =
true;
1256void QDeclarativeGeoRouteQuery::doCoordinateChanged()
1258 m_excludedAreaCoordinateChanged =
false;
void endResetModel()
Completes a model reset operation.
virtual QHash< int, QByteArray > roleNames() const
void beginResetModel()
Begins a model reset operation.
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore\reentrant
void setAutoUpdate(bool autoUpdate)
void componentComplete() override
void setQuery(QDeclarativeGeoRouteQuery *query)
Q_INVOKABLE QGeoRoute get(int index)
\qmlmethod route QtLocation::RouteModel::get(int index)
void update()
\qmlmethod void QtLocation::RouteModel::update()
Q_INVOKABLE void cancel()
\qmlmethod void QtLocation::RouteModel::cancel()
void setMeasurementSystem(QLocale::MeasurementSystem ms)
\qmlproperty Locale::MeasurementSystem QtLocation::RouteModel::measurementSystem
QVariant data(const QModelIndex &index, int role) const override
QLocale::MeasurementSystem measurementSystem
QHash< int, QByteArray > roleNames() const override
Q_INVOKABLE void reset()
\qmlmethod void QtLocation::RouteModel::reset()
QDeclarativeGeoRouteQuery * query
void setPlugin(QDeclarativeGeoServiceProvider *plugin)
QDeclarativeGeoRouteModel(QObject *parent=nullptr)
\qmltype RouteModel \instantiates QDeclarativeGeoRouteModel \inqmlmodule QtLocation
void measurementSystemChanged()
int rowCount(const QModelIndex &parent) const override
QDeclarativeGeoServiceProvider * plugin
@ MissingRequiredParameterError
QGeoRouteRequest routeRequest() const
void setDepartureTime(const QDateTime &departureTime)
\qmlproperty date RouteQuery::departureTime
ManeuverDetail maneuverDetail
Q_INVOKABLE void resetFeatureWeights()
\qmlmethod void QtLocation::RouteQuery::resetFeatureWeights()
Q_INVOKABLE void clearExcludedAreas()
\qmlmethod void QtLocation::RouteQuery::clearExcludedAreas()
void setExcludedAreas(const QList< QGeoRectangle > &value)
void maneuverDetailChanged()
void setTravelModes(TravelModes travelModes)
QDeclarativeGeoRouteQuery(QObject *parent=nullptr)
\qmltype RouteQuery \instantiates QDeclarativeGeoRouteQuery \inqmlmodule QtLocation
void routeOptimizationsChanged()
Q_INVOKABLE void removeExcludedArea(const QGeoRectangle &area)
\qmlmethod void QtLocation::RouteQuery::removeExcludedArea(georectangle area)
void excludedAreasChanged()
void setSegmentDetail(SegmentDetail segmentDetail)
\qmlproperty enumeration RouteQuery::segmentDetail
void setWaypoints(const QList< QGeoCoordinate > &value)
void setRouteOptimizations(RouteOptimizations optimization)
void queryDetailsChanged()
void setNumberAlternativeRoutes(int numberAlternativeRoutes)
void numberAlternativeRoutesChanged()
void departureTimeChanged()
int numberAlternativeRoutes
QList< QGeoRectangle > excludedAreas
RouteOptimizations routeOptimizations
QList< int > featureTypes
QList< QGeoCoordinate > waypoints
void travelModesChanged()
~QDeclarativeGeoRouteQuery()
void setManeuverDetail(ManeuverDetail maneuverDetail)
\qmlproperty enumeration RouteQuery::maneuverDetail
void featureTypesChanged()
SegmentDetail segmentDetail
Q_INVOKABLE void removeWaypoint(const QGeoCoordinate &waypoint)
\qmlmethod void QtLocation::RouteQuery::removeWaypoint(coordinate)
Q_INVOKABLE void clearWaypoints()
\qmlmethod void QtLocation::RouteQuery::clearWaypoints()
void segmentDetailChanged()
void componentComplete() override
Q_INVOKABLE void addExcludedArea(const QGeoRectangle &area)
\qmlmethod void QtLocation::RouteQuery::addExcludedArea(georectangle area)
Q_INVOKABLE int featureWeight(FeatureType featureType)
\qmlmethod FeatureWeight QtLocation::RouteQuery::featureWeight(FeatureType featureType)
Q_INVOKABLE void setFeatureWeight(FeatureType featureType, FeatureWeight featureWeight)
\qmlmethod void QtLocation::RouteQuery::setFeatureWeight(FeatureType feature, FeatureWeight weight)
Q_INVOKABLE void addWaypoint(const QGeoCoordinate &w)
\qmlmethod void QtLocation::RouteQuery::addWaypoint(coordinate)
QGeoServiceProvider * sharedGeoServiceProvider() const
bool isValid
This property holds the validity of this geo coordinate.
virtual void abort()
Cancels the operation immediately.
Error
Describes an error which prevented the completion of the operation.
QDateTime departureTime() const
Returns the departure time in the request.
SegmentDetail segmentDetail() const
Returns the level of detail which will be used in the representation of routing segments.
void setManeuverDetail(ManeuverDetail maneuverDetail)
Sets the level of detail to use when representing routing maneuvers to maneuverDetail.
void setDepartureTime(const QDateTime &departureTime)
Sets the departure time departureTime for the route calculation.
void setRouteOptimization(RouteOptimizations optimization)
Sets the optimization criteria to use while planning the route to optimization.
void setSegmentDetail(SegmentDetail segmentDetail)
Sets the level of detail to use when representing routing segments to segmentDetail.
FeatureWeight
Defines the weight to associate with a feature during the planning of a route.
FeatureWeight featureWeight(FeatureType featureType) const
Returns the weight assigned to featureType in the planning of the route.
QList< FeatureType > featureTypes() const
Returns the list of features that will be considered when planning the route.
void setWaypoints(const QList< QGeoCoordinate > &waypoints)
Sets waypoints as the waypoints that the route should pass through.
TravelModes travelModes() const
Returns the travel modes which this request specifies should be considered during the planning of the...
RouteOptimizations routeOptimization() const
Returns the optimization criteria which this request specifies should be used while planning the rout...
QList< QGeoCoordinate > waypoints() const
Returns the waypoints that the route will pass through.
SegmentDetail
Defines the amount of route segment information that should be included with the route.
void setFeatureWeight(FeatureType featureType, FeatureWeight featureWeight)
Assigns the weight featureWeight to the feature featureType during the planning of the route.
void setNumberAlternativeRoutes(int alternatives)
Sets the number of alternative routes to request to alternatives.
void setTravelModes(TravelModes travelModes)
Sets the travel modes which should be considered during the planning of the route to travelModes.
ManeuverDetail
Defines the amount of maneuver information that should be included with the route.
int numberAlternativeRoutes() const
Returns the number of alternative routes which will be requested.
void setExcludeAreas(const QList< QGeoRectangle > &areas)
Sets areas as excluded areas that the route must not cross.
QList< QGeoRectangle > excludeAreas() const
Returns areas the route must not cross.
FeatureType
Defines a feature which is important to the planning of a route.
ManeuverDetail maneuverDetail() const
Returns the level of detail which will be used in the representation of routing maneuvers.
void finished(QGeoRouteReply *reply)
This signal is emitted when reply has finished processing.
void errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of reply.
QLocale::MeasurementSystem measurementSystem() const
Returns the measurement system used by this manager.
QGeoRouteReply * calculateRoute(const QGeoRouteRequest &request)
Begins the calculation of the route specified by request.
void setMeasurementSystem(QLocale::MeasurementSystem system)
Sets the measurement system used by this manager to system.
Error routingError() const
Returns an error code describing the error which occurred during the last attempt to create a routing...
@ MissingRequiredParameterError
QString routingErrorString() const
Returns a string describing the error which occurred during the last attempt to create a routing mana...
QGeoRoutingManager * routingManager() const
Returns the QGeoRoutingManager made available by the service provider.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
bool isEmpty() const noexcept
void removeAt(qsizetype i)
const_reference at(qsizetype i) const noexcept
void remove(qsizetype i, qsizetype n=1)
qsizetype count() const noexcept
void append(parameter_type t)
MeasurementSystem measurementSystem() const
NetworkError error() const
Returns the error that was found during the processing of this request.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void deleteLater()
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static int area(const QSize &s)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define QStringLiteral(str)
myObject disconnect()
[26]
QNetworkRequest request(url)
bool contains(const AT &t) const noexcept
qsizetype lastIndexOf(const AT &t, qsizetype from=-1) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent