26 Q_PROPERTY(
double latitude READ latitude WRITE setLatitude)
27 Q_PROPERTY(
double longitude READ longitude WRITE setLongitude)
28 Q_PROPERTY(
double altitude READ altitude WRITE setAltitude)
29 Q_PROPERTY(
bool isValid READ isValid)
30 Q_PROPERTY(AltitudeType altitudeType READ altitudeType WRITE setAltitudeType
41 enum CoordinateFormat {
43 DegreesWithHemisphere,
45 DegreesMinutesWithHemisphere,
46 DegreesMinutesSeconds,
47 DegreesMinutesSecondsWithHemisphere
49 Q_ENUM(CoordinateFormat)
51 enum class AltitudeType {
59 QGeoCoordinate(
double latitude,
double longitude);
60 QGeoCoordinate(
double latitude,
double longitude,
double altitude);
61 QGeoCoordinate(
const QGeoCoordinate &other);
62 QGeoCoordinate(QGeoCoordinate &&other)
noexcept =
default;
65 QGeoCoordinate &operator=(
const QGeoCoordinate &other);
66 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGeoCoordinate)
68 void swap(QGeoCoordinate &other)
noexcept { d.swap(other.d); }
70 friend bool operator==(
const QGeoCoordinate &lhs,
const QGeoCoordinate &rhs)
72 return equals(lhs, rhs);
74 friend bool operator!=(
const QGeoCoordinate &lhs,
const QGeoCoordinate &rhs)
76 return !equals(lhs, rhs);
80 CoordinateType type()
const;
82 void setLatitude(
double latitude);
83 double latitude()
const;
85 void setLongitude(
double longitude);
86 double longitude()
const;
88 void setAltitude(
double altitude);
89 double altitude()
const;
91 void setAltitudeType(AltitudeType type);
92 AltitudeType altitudeType()
const;
94 Q_INVOKABLE qreal distanceTo(
const QGeoCoordinate &other)
const;
95 Q_INVOKABLE qreal azimuthTo(
const QGeoCoordinate &other)
const;
97 Q_INVOKABLE QGeoCoordinate atDistanceAndAzimuth(qreal distance, qreal azimuth, qreal distanceUp = 0.0)
const;
99 Q_INVOKABLE QString toString(CoordinateFormat format = DegreesMinutesSecondsWithHemisphere)
const;
102 static bool equals(
const QGeoCoordinate &lhs,
const QGeoCoordinate &rhs);
103 QGeoCoordinate(QGeoCoordinatePrivate &dd);
104 QSharedDataPointer<QGeoCoordinatePrivate> d;
105 friend class QGeoCoordinatePrivate;
106 friend class QQuickGeoCoordinateAnimation;
107#ifndef QT_NO_DEBUG_STREAM
108 friend QDebug operator<<(QDebug dbg,
const QGeoCoordinate &coord)
110 return debugStreaming(dbg, coord);
112 static QDebug debugStreaming(QDebug dbg,
const QGeoCoordinate &coord);
114#ifndef QT_NO_DATASTREAM
115 friend QDataStream &operator<<(QDataStream &stream,
const QGeoCoordinate &coordinate)
117 return dataStreamOut(stream, coordinate);
119 friend QDataStream &operator>>(QDataStream &stream, QGeoCoordinate &coordinate)
121 return dataStreamIn(stream, coordinate);
123 static QDataStream &dataStreamOut(QDataStream &stream,
const QGeoCoordinate &coordinate);
124 static QDataStream &dataStreamIn(QDataStream &stream, QGeoCoordinate &coordinate);
131Q_POSITIONING_EXPORT size_t qHash(
const QGeoCoordinate &coordinate, size_t seed = 0);