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
qgeosatelliteinfo.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#ifndef QGEOSATELLITEINFO_H
5#define QGEOSATELLITEINFO_H
6
7#include <QtPositioning/qpositioningglobal.h>
8#include <QtCore/QSharedData>
9#include <QtCore/QMetaType>
10#include <QtCore/QDebug>
11
13
14class QDebug;
15class QDataStream;
16
17class QGeoSatelliteInfo;
18Q_POSITIONING_EXPORT size_t qHash(const QGeoSatelliteInfo &key, size_t seed = 0) noexcept;
19namespace QTest
20{
21
22Q_POSITIONING_EXPORT char *toString(const QGeoSatelliteInfo &info);
23
24} // namespace QTest
25
26class QGeoSatelliteInfoPrivate;
27QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoSatelliteInfoPrivate, Q_POSITIONING_EXPORT)
28
29class Q_POSITIONING_EXPORT QGeoSatelliteInfo
30{
31 Q_GADGET
32 Q_PROPERTY(SatelliteSystem satelliteSystem READ satelliteSystem FINAL)
33 Q_PROPERTY(int satelliteIdentifier READ satelliteIdentifier FINAL)
34 Q_PROPERTY(qreal signalStrength READ signalStrength FINAL)
35
36public:
37 enum Attribute {
38 Elevation,
39 Azimuth
40 };
41 Q_ENUM(Attribute)
42
43 enum SatelliteSystem {
44 Undefined = 0x00,
45 GPS = 0x01,
46 GLONASS = 0x02,
47 GALILEO = 0x03,
48 BEIDOU = 0x04,
49 QZSS = 0x05,
50 IRNSS = 0x06,
51 SBAS = 0x07,
52 Multiple = 0xFF,
53 CustomType = 0x100
54 };
55 Q_ENUM(SatelliteSystem)
56
57 QGeoSatelliteInfo();
58 QGeoSatelliteInfo(const QGeoSatelliteInfo &other);
59 QGeoSatelliteInfo(QGeoSatelliteInfoPrivate &dd);
60 QGeoSatelliteInfo(QGeoSatelliteInfo &&other) noexcept = default;
61 ~QGeoSatelliteInfo();
62
63 QGeoSatelliteInfo &operator=(const QGeoSatelliteInfo &other);
64 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGeoSatelliteInfo)
65
66 void swap(QGeoSatelliteInfo &other) noexcept { d.swap(other.d); }
67
68 friend bool operator==(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)
69 {
70 return equals(lhs, rhs);
71 }
72 friend bool operator!=(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)
73 {
74 return !equals(lhs, rhs);
75 }
76
77 void setSatelliteSystem(SatelliteSystem system);
78 SatelliteSystem satelliteSystem() const;
79
80 void setSatelliteIdentifier(int satId);
81 int satelliteIdentifier() const;
82
83 void setSignalStrength(int signalStrength);
84 int signalStrength() const;
85
86 void setAttribute(Attribute attribute, qreal value);
87 Q_INVOKABLE qreal attribute(Attribute attribute) const;
88 void removeAttribute(Attribute attribute);
89
90 Q_INVOKABLE bool hasAttribute(Attribute attribute) const;
91
92 void detach();
93
94private:
95 static bool equals(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs);
96#ifndef QT_NO_DEBUG_STREAM
97 friend QDebug operator<<(QDebug dbg, const QGeoSatelliteInfo &info)
98 {
99 return debugStreaming(dbg, info);
100 }
101 static QDebug debugStreaming(QDebug dbg, const QGeoSatelliteInfo &info);
102#endif
103#ifndef QT_NO_DATASTREAM
104 friend QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info)
105 {
106 return dataStreamOut(stream, info);
107 }
108 friend QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info)
109 {
110 return dataStreamIn(stream, info);
111 }
112 static QDataStream &dataStreamOut(QDataStream &stream, const QGeoSatelliteInfo &info);
113 static QDataStream &dataStreamIn(QDataStream &stream, QGeoSatelliteInfo &info);
114#endif
115 QExplicitlySharedDataPointer<QGeoSatelliteInfoPrivate> d;
116 friend class QGeoSatelliteInfoPrivate;
117
118 friend Q_POSITIONING_EXPORT size_t qHash(const QGeoSatelliteInfo &key, size_t seed) noexcept;
119 friend Q_POSITIONING_EXPORT char *QTest::toString(const QGeoSatelliteInfo &info);
120};
121
123
124QT_END_NAMESPACE
125
126QT_DECL_METATYPE_EXTERN(QGeoSatelliteInfo, Q_POSITIONING_EXPORT)
127
128#endif
\inmodule QtPositioning
void satellitesChanged(GypsySatellite *satellite, GPtrArray *satellites)
void requestUpdate(int timeout=5000) override
int init(const QVariantMap parameters)
Error error() const override
Returns the last error that occurred.
\inmodule QtPositioning
\inmodule QtPositioning
Combined button and popup list for selecting options.
char * toString(const QGeoSatelliteInfo &info)
Q_DECLARE_INTERFACE(QNetworkAccessBackendFactory, QNetworkAccessBackendFactory_iid)