QGeoSatelliteInfo Class

The QGeoSatelliteInfo class contains basic information about a satellite. More...

Header: #include <QGeoSatelliteInfo>
CMake: find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
qmake: QT += positioning

Public Types

enum Attribute { Elevation, Azimuth }
enum SatelliteSystem { Undefined, GPS, GLONASS, GALILEO, BEIDOU, …, CustomType }

Public Functions

QGeoSatelliteInfo()
QGeoSatelliteInfo(const QGeoSatelliteInfo &other)
(since 6.2) QGeoSatelliteInfo(QGeoSatelliteInfo &&other)
~QGeoSatelliteInfo()
qreal attribute(QGeoSatelliteInfo::Attribute attribute) const
bool hasAttribute(QGeoSatelliteInfo::Attribute attribute) const
void removeAttribute(QGeoSatelliteInfo::Attribute attribute)
int satelliteIdentifier() const
QGeoSatelliteInfo::SatelliteSystem satelliteSystem() const
void setAttribute(QGeoSatelliteInfo::Attribute attribute, qreal value)
void setSatelliteIdentifier(int satId)
void setSatelliteSystem(QGeoSatelliteInfo::SatelliteSystem system)
void setSignalStrength(int signalStrength)
int signalStrength() const
QGeoSatelliteInfo &operator=(const QGeoSatelliteInfo &other)
(since 6.2) QGeoSatelliteInfo &operator=(QGeoSatelliteInfo &&other)
bool operator!=(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)
QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info)
bool operator==(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)
QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info)

Detailed Description

See also QGeoSatelliteInfoSource.

Member Type Documentation

enum QGeoSatelliteInfo::Attribute

Defines the attributes for the satellite information.

ConstantValueDescription
QGeoSatelliteInfo::Elevation0The elevation of the satellite, in degrees.
QGeoSatelliteInfo::Azimuth1The azimuth to true north, in degrees.

enum QGeoSatelliteInfo::SatelliteSystem

Defines the GNSS system of the satellite.

ConstantValueDescription
QGeoSatelliteInfo::Undefined0x00Not defined.
QGeoSatelliteInfo::GPS0x01Global Positioning System (USA).
QGeoSatelliteInfo::GLONASS0x02Global Positioning System (Russia).
QGeoSatelliteInfo::GALILEO0x03Global navigation satellite system (EU).
QGeoSatelliteInfo::BEIDOU0x04BeiDou navigation satellite system (China).
QGeoSatelliteInfo::QZSS0x05Quasi-Zenith Satellite System (Japan).
QGeoSatelliteInfo::Multiple0xFFThis type normally indicates that the information is received from a device that supports multiple satellite systems, and the satellite system is not explicitly specified. Depending on the data source, you might use other information to determine the actual system type. One example of the usage of this type is an NMEA $GNGSA message, which contains the IDs of the satellites being used, but does not explicitly mention their system types.
QGeoSatelliteInfo::CustomType0x100The first type that can be used for user purposes. For example when reimplementing NMEA data parsing in QNmeaSatelliteInfoSource. User can add more types using CustomType + 1, CustomType + 2 and so on.

Member Function Documentation

QGeoSatelliteInfo::QGeoSatelliteInfo()

Creates a satellite information object.

QGeoSatelliteInfo::QGeoSatelliteInfo(const QGeoSatelliteInfo &other)

Creates a satellite information object with the values of other.

[noexcept, since 6.2] QGeoSatelliteInfo::QGeoSatelliteInfo(QGeoSatelliteInfo &&other)

Creates a satellite information object by moving from other.

Note that a moved-from QGeoSatelliteInfo can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined.

This function was introduced in Qt 6.2.

[noexcept] QGeoSatelliteInfo::~QGeoSatelliteInfo()

Destroys a satellite information object.

[invokable] qreal QGeoSatelliteInfo::attribute(QGeoSatelliteInfo::Attribute attribute) const

Returns the value of the specified attribute as a qreal value.

Returns -1 if the value has not been set.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

See also hasAttribute() and setAttribute().

[invokable] bool QGeoSatelliteInfo::hasAttribute(QGeoSatelliteInfo::Attribute attribute) const

Returns true if the specified attribute is present in this update.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

void QGeoSatelliteInfo::removeAttribute(QGeoSatelliteInfo::Attribute attribute)

Removes the specified attribute and its value.

int QGeoSatelliteInfo::satelliteIdentifier() const

Returns the satellite identifier number.

The satellite identifier number can be used to identify a satellite within the satellite system.

The actual value may vary, depending on the platform and the selected backend.

For example, if nmea plugin is used, the satellite identifier for GPS satellite system represents the PRN (Pseudo-random noise) number, and the satellite identifier for GLONASS satellite system represents the slot number.

For NMEA-based backends the satellite identifier can be used to determine the satellite system type if it is not available from other sources. You can refer to satellite IDs list to check the ID ranges for different satellite systems.

Note: Depending on the platform and the selected backend, the satellite identifier ranges for different satellite systems may intersect. To uniquely identify a satellite, a combination of satelliteIndetifier() and satelliteSystem() must be used.

Note: Getter function for property satelliteIdentifier.

See also setSatelliteIdentifier() and satelliteSystem().

QGeoSatelliteInfo::SatelliteSystem QGeoSatelliteInfo::satelliteSystem() const

Returns the Satellite System (GPS, GLONASS, ...)

Note: This value can be used together with satelliteIdentifier() to uniquely identify a satellite.

Note: Getter function for property satelliteSystem.

See also setSatelliteSystem() and satelliteIdentifier().

void QGeoSatelliteInfo::setAttribute(QGeoSatelliteInfo::Attribute attribute, qreal value)

Sets the value for attribute to value.

See also attribute().

void QGeoSatelliteInfo::setSatelliteIdentifier(int satId)

Sets the satellite identifier number to satId.

The satellite identifier number can be used to identify a satellite within the satellite system.

The actual value may vary, depending on the platform and the selected backend.

For example, if nmea plugin is used, the satellite identifier for GPS satellite system represents the PRN (Pseudo-random noise) number, and the satellite identifier for GLONASS satellite system represents the slot number.

See also satelliteIdentifier().

void QGeoSatelliteInfo::setSatelliteSystem(QGeoSatelliteInfo::SatelliteSystem system)

Sets the Satellite System (GPS, GLONASS, ...) to system.

See also satelliteSystem().

void QGeoSatelliteInfo::setSignalStrength(int signalStrength)

Sets the signal strength to signalStrength, in decibels.

See also signalStrength().

int QGeoSatelliteInfo::signalStrength() const

Returns the signal strength, or -1 if the value has not been set.

Note: Getter function for property signalStrength.

See also setSignalStrength().

QGeoSatelliteInfo &QGeoSatelliteInfo::operator=(const QGeoSatelliteInfo &other)

Assigns the values from other to this object.

[noexcept, since 6.2] QGeoSatelliteInfo &QGeoSatelliteInfo::operator=(QGeoSatelliteInfo &&other)

Move-assigns the value from other to this object

Note that a moved-from QGeoSatelliteInfo can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined.

This function was introduced in Qt 6.2.

Related Non-Members

bool operator!=(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)

Returns true if any of the parameters of the lhs satellite are not the same as those of rhs. Otherwise returns false.

QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info)

Writes the given info to the specified stream.

See also Serializing Qt Data Types.

bool operator==(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)

Returns true if all the parameters of the lhs satellite are the same as those of rhs. Otherwise returns false.

QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info)

Reads satellite information from the specified stream into the given info.

See also Serializing Qt Data Types.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.