The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time. More...
#include <QGeoPositionInfo>
This class was introduced in Qt Mobility 1.0.
enum | Attribute { Direction, GroundSpeed, VerticalSpeed, MagneticVariation, HorizontalAccuracy, VerticalAccuracy } |
QGeoPositionInfo () | |
QGeoPositionInfo ( const QGeoCoordinate & coordinate, const QDateTime & timestamp ) | |
QGeoPositionInfo ( const QGeoPositionInfo & other ) | |
~QGeoPositionInfo () | |
qreal | attribute ( Attribute attribute ) const |
QGeoCoordinate | coordinate () const |
bool | hasAttribute ( Attribute attribute ) const |
bool | isValid () const |
void | removeAttribute ( Attribute attribute ) |
void | setAttribute ( Attribute attribute, qreal value ) |
void | setCoordinate ( const QGeoCoordinate & coordinate ) |
void | setTimestamp ( const QDateTime & timestamp ) |
QDateTime | timestamp () const |
bool | operator!= ( const QGeoPositionInfo & other ) const |
QGeoPositionInfo & | operator= ( const QGeoPositionInfo & other ) |
bool | operator== ( const QGeoPositionInfo & other ) const |
QDataStream & | operator<< ( QDataStream & stream, const QGeoPositionInfo & info ) |
QDataStream & | operator>> ( QDataStream & stream, QGeoPositionInfo & info ) |
The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time.
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 to true north from the direction of travel, in degrees. |
QGeoPositionInfo::GroundSpeed | 1 | The ground speed, in metres/sec. |
QGeoPositionInfo::VerticalSpeed | 2 | The vertical speed, in metres/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 metres. |
QGeoPositionInfo::VerticalAccuracy | 5 | The accuracy of the provided altitude value, in metres. |
Creates an invalid QGeoPositionInfo object.
See also isValid().
Creates a QGeoPositionInfo for the given coordinate and timestamp.
This function was introduced in Qt Mobility 1.0.
Creates a QGeoPositionInfo with the values of other.
This function was introduced in Qt Mobility 1.0.
Destroys a QGeoPositionInfo object.
Returns the value of the specified attribute as a qreal value.
Returns -1 if the value has not been set, although this may also be a legitimate value for some attributes.
The function hasAttribute() should be used to determine whether or not a value has been set for an attribute.
This function was introduced in Qt Mobility 1.0.
See also hasAttribute() and setAttribute().
Returns the coordinate for this position.
Returns an invalid coordinate if no coordinate has been set.
This function was introduced in Qt Mobility 1.0.
See also setCoordinate().
Returns true if the specified attribute is present for this QGeoPositionInfo object.
This function was introduced in Qt Mobility 1.0.
Returns true if the timestamp() and coordinate() values are both valid.
This function was introduced in Qt Mobility 1.0.
See also QGeoCoordinate::isValid() and QDateTime::isValid().
Removes the specified attribute and its value.
This function was introduced in Qt Mobility 1.0.
Sets the value for attribute to value.
This function was introduced in Qt Mobility 1.0.
See also attribute().
Sets the coordinate for this position to coordinate.
This function was introduced in Qt Mobility 1.0.
See also coordinate().
Sets the date and time at which this position was reported to timestamp.
The timestamp must be in UTC time.
This function was introduced in Qt Mobility 1.0.
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.
This function was introduced in Qt Mobility 1.0.
See also setTimestamp().
Returns true if any of this object's values are not the same as those of other.
This function was introduced in Qt Mobility 1.0.
Assigns the values from other to this QGeoPositionInfo.
This function was introduced in Qt Mobility 1.0.
Returns true if all of this object's values are the same as those of other.
This function was introduced in Qt Mobility 1.0.
Writes the given info to the specified stream.
This function was introduced in Qt Mobility 1.0.
See also Serializing Qt Data Types.
Reads a coordinate from the specified stream into the given info.
This function was introduced in Qt Mobility 1.0.
See also Serializing Qt Data Types.