Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qgeoroute.h
Go to the documentation of this file.
1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGEOROUTE_H
5#define QGEOROUTE_H
6
7#include <QtLocation/QGeoRouteRequest>
8
9#include <QtCore/QObject>
10#include <QtCore/QExplicitlySharedDataPointer>
11#include <QtCore/QList>
12
13#include "QtQml/qqml.h"
14
16
17class QGeoCoordinate;
18class QGeoRectangle;
20
23class Q_LOCATION_EXPORT QGeoRoute
24{
26 QML_VALUE_TYPE(route)
28
29 Q_PROPERTY(QString routeId READ routeId CONSTANT)
31 Q_PROPERTY(int travelTime READ travelTime CONSTANT)
36 Q_PROPERTY(int legIndex READ legIndex CONSTANT)
37 Q_PROPERTY(QGeoRoute overallRoute READ overallRoute CONSTANT)
40
41public:
42 QGeoRoute();
43 QGeoRoute(const QGeoRoute &other) noexcept;
44 QGeoRoute(QGeoRoute &&other) noexcept = default;
46
47 QGeoRoute &operator=(const QGeoRoute &other) noexcept;
48 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QGeoRoute)
49
50 void swap(QGeoRoute &other) noexcept { d_ptr.swap(other.d_ptr); }
51
52 friend inline bool operator==(const QGeoRoute &lhs, const QGeoRoute &rhs) noexcept
53 { return lhs.isEqual(rhs); }
54 friend inline bool operator!=(const QGeoRoute &lhs, const QGeoRoute &rhs) noexcept
55 { return !lhs.isEqual(rhs); }
56
57 void setRouteId(const QString &id);
58 QString routeId() const;
59
62
63 void setBounds(const QGeoRectangle &bounds);
64 QGeoRectangle bounds() const;
65
66 void setFirstRouteSegment(const QGeoRouteSegment &routeSegment);
67 QGeoRouteSegment firstRouteSegment() const;
69 QList<QGeoRouteSegment> segments() const;
70
71 void setTravelTime(int secs);
72 int travelTime() const;
73
75 qreal distance() const;
76
79
80 void setPath(const QList<QGeoCoordinate> &path);
81 QList<QGeoCoordinate> path() const;
82
83 void setRouteLegs(const QList<QGeoRoute> &legs);
84 QList<QGeoRoute> routeLegs() const;
85
88
89 void setLegIndex(int idx);
90 int legIndex() const;
91
92 void setOverallRoute(const QGeoRoute &route);
93 QGeoRoute overallRoute() const;
94
95protected:
96 QExplicitlySharedDataPointer<QGeoRoutePrivate> &d();
97 const QExplicitlySharedDataPointer<QGeoRoutePrivate> &const_d() const;
98
99private:
100 QExplicitlySharedDataPointer<QGeoRoutePrivate> d_ptr;
101 bool isEqual(const QGeoRoute &other) const noexcept;
102
103 friend class QDeclarativeGeoRoute;
104 friend class QGeoRoutePrivate;
105};
106
108
109#endif
static bool isEqual(const aiUVTransform &a, const aiUVTransform &b)
\inmodule QtPositioning
\inmodule QtPositioning
void setLegIndex(int idx)
QVariantMap extendedAttributes() const
void setTravelTime(int travelTime)
void setDistance(qreal distance)
void setTravelMode(QGeoRouteRequest::TravelMode mode)
int segmentsCount() const
void setRouteLegs(const QList< QGeoRoute > &legs)
void setBounds(const QGeoRectangle &bounds)
QList< QGeoRoute > routeLegs() const
QGeoRouteRequest::TravelMode travelMode() const
QGeoRectangle bounds() const
void setExtendedAttributes(const QVariantMap &extendedAttributes)
int legIndex() const
void setPath(const QList< QGeoCoordinate > &path)
void setRequest(const QGeoRouteRequest &request)
int travelTime() const
\inmodule QtLocation
TravelMode
Defines modes of travel to be used for a route.
\inmodule QtLocation
\inmodule QtLocation
Definition qgeoroute.h:24
void swap(QGeoRoute &other) noexcept
Definition qgeoroute.h:50
friend bool operator==(const QGeoRoute &lhs, const QGeoRoute &rhs) noexcept
Returns whether the routes lhs and rhs are equal.
Definition qgeoroute.h:52
friend bool operator!=(const QGeoRoute &lhs, const QGeoRoute &rhs) noexcept
Returns whether the routes lhs and rhs are not equal.
Definition qgeoroute.h:54
Definition qlist.h:75
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLenum mode
GLsizei GLsizei GLfloat distance
GLsizei const GLchar *const * path
GLuint segments
#define QML_VALUE_TYPE(NAME)
#define QML_STRUCTURED_VALUE
#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)
#define Q_PROPERTY(...)
#define Q_GADGET
ptrdiff_t qsizetype
Definition qtypes.h:165
double qreal
Definition qtypes.h:187
QSharedPointer< T > other(t)
[5]
this swap(other)
QNetworkRequest request(url)