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
qgeolocation.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 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#include "qgeolocation.h"
5#include "qgeolocation_p.h"
6
8
10
15
17 : QSharedData()
18{
19 this->address = other.address;
20 this->coordinate = other.coordinate;
21 this->viewport = other.viewport;
23}
24
28
30{
31 return (this->address == other.address
32 && this->coordinate == other.coordinate
33 && this->viewport == other.viewport
34 && this->extendedAttributes == other.extendedAttributes);
35
36}
37
39{
40 return (address.isEmpty()
42 && viewport.isEmpty()
44}
45
67
75
93
95
96
100{
101 if (this == &other)
102 return *this;
103
104 d = other.d;
105 return *this;
106}
107
138{
139 return d->address;
140}
141
149
154{
155 return d->coordinate;
156}
157
162{
164}
165
182{
183 return d->viewport;
184}
185
192{
194}
195
206
217
224{
225 return d->isEmpty();
226}
227
228bool QGeoLocation::equals(const QGeoLocation &lhs, const QGeoLocation &rhs)
229{
230 return (*(lhs.d.constData()) == *(rhs.d.constData()));
231}
232
243size_t qHash(const QGeoLocation &location, size_t seed) noexcept
244{
245 return qHashMulti(seed, location.coordinate(), location.boundingShape(), location.address());
246}
247
\inmodule QtPositioning
Definition qgeoaddress.h:18
\inmodule QtPositioning
bool isValid
This property holds the validity of this geo coordinate.
bool operator==(const QGeoLocationPrivate &other) const
QVariantMap extendedAttributes
QGeoCoordinate coordinate
\inmodule QtPositioning
~QGeoLocation()
Destroys the location object.
bool isEmpty() const
Returns true if the location coordinate is \l {QGeoCoordinate::isValid} {invalid},...
QVariantMap extendedAttributes() const
Returns the extended attributes associated to this location.
size_t qHash(const QGeoLocation &location, size_t seed) noexcept
Returns the hash value for the location, using seed for the calculation.
QGeoAddress address() const
Returns the address of the location.
void setExtendedAttributes(const QVariantMap &data)
Sets the extended attributes of the location with the parameters specified in data.
QGeoCoordinate coordinate() const
Returns the coordinate of the location.
QGeoShape boundingShape() const
void setCoordinate(const QGeoCoordinate &position)
Sets the coordinate of the location.
void setAddress(const QGeoAddress &address)
Sets the address of the location.
void setBoundingShape(const QGeoShape &shape)
QGeoLocation()
Constructs an new location object.
\inmodule QtPositioning
Definition qgeoshape.h:17
bool isEmpty
This property defines whether this geo shape is empty.
Definition qgeoshape.h:21
bool isEmpty() const
Definition qmap.h:269
const T * constData() const noexcept
Returns a const pointer to the shared data object.
Definition qshareddata.h:51
\inmodule QtCore
Definition qshareddata.h:19
#define this
Definition dialogs.cpp:9
Combined button and popup list for selecting options.
constexpr QtPrivate::QHashMultiReturnType< T... > qHashMulti(size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >)
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1390
GLint location
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint64EXT address
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR(Class)
QSharedPointer< T > other(t)
[5]