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
qgeoaddress.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 QGEOADDRESS_H
5#define QGEOADDRESS_H
6
7#include <QtCore/QMetaType>
8#include <QtCore/QSharedDataPointer>
9#include <QtPositioning/qpositioningglobal.h>
10
12
13class QString;
14class QGeoAddressPrivate;
15QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoAddressPrivate, Q_POSITIONING_EXPORT)
16
17class Q_POSITIONING_EXPORT QGeoAddress
18{
19public:
20 QGeoAddress();
21 QGeoAddress(const QGeoAddress &other);
22 QGeoAddress(QGeoAddress &&other) noexcept = default;
23 ~QGeoAddress();
24
25 QGeoAddress &operator=(const QGeoAddress &other);
26 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGeoAddress)
27
28 void swap(QGeoAddress &other) noexcept { d.swap(other.d); }
29
30 friend bool operator==(const QGeoAddress &lhs, const QGeoAddress &rhs)
31 {
32 return equals(lhs, rhs);
33 }
34 friend bool operator!=(const QGeoAddress &lhs, const QGeoAddress &rhs)
35 {
36 return !equals(lhs, rhs);
37 }
38
39 QString text() const;
40 void setText(const QString &text);
41
42 QString country() const;
43 void setCountry(const QString &country);
44
45 QString countryCode() const;
46 void setCountryCode(const QString &countryCode);
47
48 QString state() const;
49 void setState(const QString &state);
50
51 QString county() const;
52 void setCounty(const QString &county);
53
54 QString city() const;
55 void setCity(const QString &city);
56
57 QString district() const;
58 void setDistrict(const QString &district);
59
60 QString postalCode() const;
61 void setPostalCode(const QString &postalCode);
62
63 QString street() const;
64 void setStreet(const QString &street);
65
66 QString streetNumber() const;
67 void setStreetNumber(const QString &streetNumber);
68
69 bool isEmpty() const;
70 void clear();
71
72 bool isTextGenerated() const;
73
74private:
75 static bool equals(const QGeoAddress &lhs, const QGeoAddress &rhs);
76 QSharedDataPointer<QGeoAddressPrivate> d;
77};
78
79Q_POSITIONING_EXPORT size_t qHash(const QGeoAddress &address, size_t seed = 0) noexcept;
80
82
83QT_END_NAMESPACE
84
85QT_DECL_METATYPE_EXTERN(QGeoAddress, Q_POSITIONING_EXPORT)
86
87#endif
\inmodule QtPositioning
Definition qgeoaddress.h:18
Combined button and popup list for selecting options.