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
4#ifndef QGEOLOCATION_H
5#define QGEOLOCATION_H
6
7#include <QtCore/QSharedDataPointer>
8#include <QtCore/QMetaType>
9#include <QtPositioning/qpositioningglobal.h>
10
11QT_BEGIN_NAMESPACE
12
13class QGeoAddress;
14class QGeoCoordinate;
15class QGeoShape;
16class QGeoLocationPrivate;
17QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoLocationPrivate, Q_POSITIONING_EXPORT)
18
19class Q_POSITIONING_EXPORT QGeoLocation
20{
21public:
22 QGeoLocation();
23 QGeoLocation(const QGeoLocation &other);
24 QGeoLocation(QGeoLocation &&other) noexcept = default;
25 ~QGeoLocation();
26
27 QGeoLocation &operator=(const QGeoLocation &other);
28 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGeoLocation)
29
30 void swap(QGeoLocation &other) noexcept { d.swap(other.d); }
31
32 friend bool operator==(const QGeoLocation &lhs, const QGeoLocation &rhs)
33 {
34 return equals(lhs, rhs);
35 }
36 friend bool operator!=(const QGeoLocation &lhs, const QGeoLocation &rhs)
37 {
38 return !equals(lhs, rhs);
39 }
40
41 QGeoAddress address() const;
42 void setAddress(const QGeoAddress &address);
43 QGeoCoordinate coordinate() const;
44 void setCoordinate(const QGeoCoordinate &position);
45 QGeoShape boundingShape() const;
46 void setBoundingShape(const QGeoShape &shape);
47 QVariantMap extendedAttributes() const;
48 void setExtendedAttributes(const QVariantMap &data);
49
50 bool isEmpty() const;
51
52private:
53 static bool equals(const QGeoLocation &lhs, const QGeoLocation &rhs);
54 QSharedDataPointer<QGeoLocationPrivate> d;
55};
56
57Q_POSITIONING_EXPORT size_t qHash(const QGeoLocation &location, size_t seed = 0) noexcept;
58
60
61QT_END_NAMESPACE
62
63QT_DECL_METATYPE_EXTERN(QGeoLocation, Q_POSITIONING_EXPORT)
64
65#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:191