QGeoPositionInfo Class▲
-
Header: QGeoPositionInfo
-
Since: Qt 5.2
-
qmake: QT += positioning
-
Group: QGeoPositionInfo is part of QtPositioning-positioning
Detailed Description▲
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▲
See also QGeoPositionInfoSource
Member Type Documentation▲
enum QGeoPositionInfo::Attribute▲
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. |
Member Function Documentation▲
QGeoPositionInfo::QGeoPositionInfo()▲
QGeoPositionInfo::QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime ×tamp)▲
Creates a QGeoPositionInfo for the given coordinate and timestamp.
QGeoPositionInfo::QGeoPositionInfo(const QGeoPositionInfo &other)▲
Creates a QGeoPositionInfo with the values of other.
QGeoPositionInfo::~QGeoPositionInfo()▲
Destroys a QGeoPositionInfo object.
qreal QGeoPositionInfo::attribute(QGeoPositionInfo::Attribute attribute) const▲
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▲
See also hasAttribute(), setAttribute()
QGeoCoordinate QGeoPositionInfo::coordinate() const▲
Returns the coordinate for this position.
Returns an invalid coordinate if no coordinate has been set.
See Also▲
See also setCoordinate()
bool QGeoPositionInfo::hasAttribute(QGeoPositionInfo::Attribute attribute) const▲
Returns true if the specified attribute is present for this QGeoPositionInfo object.
bool QGeoPositionInfo::isValid() const▲
Returns true if the timestamp() and coordinate() values are both valid.
See Also▲
See also QGeoCoordinate::isValid(), QDateTime::isValid()
void QGeoPositionInfo::removeAttribute(QGeoPositionInfo::Attribute attribute)▲
Removes the specified attribute and its value.
void QGeoPositionInfo::setAttribute(QGeoPositionInfo::Attribute attribute, qreal value)▲
void QGeoPositionInfo::setCoordinate(const QGeoCoordinate &coordinate)▲
void QGeoPositionInfo::setTimestamp(const QDateTime ×tamp)▲
Sets the date and time at which this position was reported to timestamp.
The timestamp must be in UTC time.
See Also▲
See also timestamp()
QDateTime QGeoPositionInfo::timestamp() const▲
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▲
See also setTimestamp()
bool QGeoPositionInfo::operator!=(const QGeoPositionInfo &other) const▲
Returns true if any of this object's values are not the same as those of other.
QGeoPositionInfo &QGeoPositionInfo::operator=(const QGeoPositionInfo &other)▲
Assigns the values from other to this QGeoPositionInfo.
bool QGeoPositionInfo::operator==(const QGeoPositionInfo &other) const▲
Returns true if all of this object's values are the same as those of other.
Related Non-Members▲
QDataStream &operator<<(QDataStream &stream, QGeoPositionInfo::Attribute attr)▲
Writes the given attr enumeration to the specified stream.
See Also▲
See also Serializing Qt Data Types
QDataStream &operator<<(QDataStream &stream, const QGeoPositionInfo &info)▲
QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo::Attribute &attr)▲
Reads an attribute enumeration from the specified stream info the given attr.
See Also▲
See also Serializing Qt Data Types
QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo &info)▲
Reads a coordinate from the specified stream into the given info.
See Also▲
See also Serializing Qt Data Types