The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time. More...
Header: | #include <QGeoPositionInfo> |
qmake: | QT += positioning |
Since: | Qt 5.2 |
This class was introduced in Qt 5.2.
enum | Attribute { Direction, GroundSpeed, VerticalSpeed, MagneticVariation, HorizontalAccuracy, VerticalAccuracy } |
QGeoPositionInfo(const QGeoPositionInfo &other) | |
QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime ×tamp) | |
QGeoPositionInfo() | |
QGeoPositionInfo & | operator=(const QGeoPositionInfo &other) |
~QGeoPositionInfo() | |
qreal | attribute(QGeoPositionInfo::Attribute attribute) const |
QGeoCoordinate | coordinate() const |
bool | hasAttribute(QGeoPositionInfo::Attribute attribute) const |
bool | isValid() const |
void | removeAttribute(QGeoPositionInfo::Attribute attribute) |
void | setAttribute(QGeoPositionInfo::Attribute attribute, qreal value) |
void | setCoordinate(const QGeoCoordinate &coordinate) |
void | setTimestamp(const QDateTime ×tamp) |
QDateTime | timestamp() const |
bool | operator!=(const QGeoPositionInfo &other) const |
bool | operator==(const QGeoPositionInfo &other) const |
QDataStream & | operator<<(QDataStream &stream, QGeoPositionInfo::Attribute attr) |
QDataStream & | operator<<(QDataStream &stream, const QGeoPositionInfo &info) |
QDataStream & | operator>>(QDataStream &stream, QGeoPositionInfo::Attribute &attr) |
QDataStream & | operator>>(QDataStream &stream, QGeoPositionInfo &info) |
A QGeoPositionInfo contains, at a minimum, a geographical coordinate and a timestamp. It may also have heading and speed measurements as well as estimates of the accuracy of the provided data.
See also QGeoPositionInfoSource.
Defines the attributes for positional information.
Constant | Value | Description |
---|---|---|
QGeoPositionInfo::Direction |
0 |
The bearing measured in degrees clockwise from true north to the direction of travel. |
QGeoPositionInfo::GroundSpeed |
1 |
The ground speed, in meters/sec. |
QGeoPositionInfo::VerticalSpeed |
2 |
The vertical speed, in meters/sec. |
QGeoPositionInfo::MagneticVariation |
3 |
The angle between the horizontal component of the magnetic field and true north, in degrees. Also known as magnetic declination. A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction. |
QGeoPositionInfo::HorizontalAccuracy |
4 |
The accuracy of the provided latitude-longitude value, in meters. |
QGeoPositionInfo::VerticalAccuracy |
5 |
The accuracy of the provided altitude value, in meters. |
Creates a QGeoPositionInfo with the values of other.
Creates a QGeoPositionInfo for the given coordinate and timestamp.
Creates an invalid QGeoPositionInfo object.
See also isValid().
Assigns the values from other to this QGeoPositionInfo.
Destroys a QGeoPositionInfo object.
Returns the value of the specified attribute as a qreal value.
Returns NaN if the value has not been set.
The function hasAttribute() should be used to determine whether or not a value has been set for an attribute.
See also hasAttribute() and setAttribute().
Returns the coordinate for this position.
Returns an invalid coordinate if no coordinate has been set.
See also setCoordinate().
Returns true if the specified attribute is present for this QGeoPositionInfo object.
Returns true if the timestamp() and coordinate() values are both valid.
See also QGeoCoordinate::isValid() and QDateTime::isValid().
Removes the specified attribute and its value.
Sets the value for attribute to value.
See also attribute().
Sets the coordinate for this position to coordinate.
See also coordinate().
Sets the date and time at which this position was reported to timestamp.
The timestamp must be in UTC time.
See also timestamp().
Returns the date and time at which this position was reported, in UTC time.
Returns an invalid QDateTime if no date/time value has been set.
See also setTimestamp().
Returns true if any of this object's values are not the same as those of other.
Returns true if all of this object's values are the same as those of other.
Writes the given attr enumeration to the specified stream.
See also Serializing Qt Data Types.
Writes the given info to the specified stream.
See also Serializing Qt Data Types.
Reads an attribute enumeration from the specified stream info the given attr.
See also Serializing Qt Data Types.
Reads a coordinate from the specified stream into the given info.
See also Serializing Qt Data Types.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qgeopositioninfo.html