Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgeolocation.h
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// Qt-Security score:significant reason:default
4
5#ifndef QGEOLOCATION_H
6#define QGEOLOCATION_H
7
8#include <QtCore/QSharedDataPointer>
9#include <QtCore/QMetaType>
10#include <QtPositioning/qpositioningglobal.h>
11
12QT_BEGIN_NAMESPACE
13
14class QGeoAddress;
15class QGeoCoordinate;
16class QGeoShape;
17class QGeoLocationPrivate;
18QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoLocationPrivate, Q_POSITIONING_EXPORT)
19
20class Q_POSITIONING_EXPORT QGeoLocation
21{
22public:
23 QGeoLocation();
24 QGeoLocation(const QGeoLocation &other);
25 QGeoLocation(QGeoLocation &&other) noexcept = default;
26 ~QGeoLocation();
27
28 QGeoLocation &operator=(const QGeoLocation &other);
29 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGeoLocation)
30
31 void swap(QGeoLocation &other) noexcept { d.swap(other.d); }
32
33 friend bool operator==(const QGeoLocation &lhs, const QGeoLocation &rhs)
34 {
35 return equals(lhs, rhs);
36 }
37 friend bool operator!=(const QGeoLocation &lhs, const QGeoLocation &rhs)
38 {
39 return !equals(lhs, rhs);
40 }
41
42 QGeoAddress address() const;
43 void setAddress(const QGeoAddress &address);
44 QGeoCoordinate coordinate() const;
45 void setCoordinate(const QGeoCoordinate &position);
46 QGeoShape boundingShape() const;
47 void setBoundingShape(const QGeoShape &shape);
48 QVariantMap extendedAttributes() const;
49 void setExtendedAttributes(const QVariantMap &data);
50
51 bool isEmpty() const;
52
53private:
54 static bool equals(const QGeoLocation &lhs, const QGeoLocation &rhs);
55 QSharedDataPointer<QGeoLocationPrivate> d;
56};
57
58Q_POSITIONING_EXPORT size_t qHash(const QGeoLocation &location, size_t seed = 0) noexcept;
59
61
62QT_END_NAMESPACE
63
64QT_DECL_METATYPE_EXTERN(QGeoLocation, Q_POSITIONING_EXPORT)
65
66#endif
\inmodule QtPositioning
Combined button and popup list for selecting options.
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192