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