Since: 1.0

#include <QtLocationSubset/QGeoPositionInfo>

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.


Public Functions Index

QGeoPositionInfo ()
QGeoPositionInfo (const QGeoCoordinate &coordinate, const QDateTime &updateTime)
QGeoPositionInfo (const QGeoPositionInfo &other)
~QGeoPositionInfo ()
qrealattribute (Attribute attribute) const
QGeoCoordinatecoordinate () const
boolhasAttribute (Attribute attribute) const
boolisValid () const
booloperator!= (const QGeoPositionInfo &other) const
QGeoPositionInfo &operator= (const QGeoPositionInfo &other)
booloperator== (const QGeoPositionInfo &other) const
voidremoveAttribute (Attribute attribute)
voidsetAttribute (Attribute attribute, qreal value)
voidsetCoordinate (const QGeoCoordinate &coordinate)
voidsetTimestamp (const QDateTime &timestamp)
QDateTimetimestamp () const

Public Types


Defines the attributes for positional information.

Direction The bearing to true north from the direction of travel, in degrees. GroundSpeed The ground speed, in meters/sec. VerticalSpeed The vertical speed, in meters/sec. MagneticVariation 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. HorizontalAccuracy The accuracy of the provided latitude-longitude value, in meters. VerticalAccuracy The accuracy of the provided altitude value, in meters.


Public Functions

QGeoPositionInfo ()

Creates an invalid QGeoPositionInfo object.

See also:


QGeoPositionInfo (

Creates a QGeoPositionInfo for the given coordinate and timestamp.

QGeoPositionInfo (

Creates a QGeoPositionInfo with the values of other.

~QGeoPositionInfo ()


qreal attribute (

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.

QGeoCoordinate coordinate ()

Returns the coordinate for this position.

Returns an invalid coordinate if no coordinate has been set.

See also:


bool hasAttribute (

Returns true if the specified attribute is present for this QGeoPositionInfo object.

bool isValid ()

Returns true if the timestamp() and coordinate() values are both valid.

See also:

QGeoCoordinate::isValid(), QDateTime::isValid()

bool operator!= (

Returns true if any of this object's values are not the same as those of other.

QGeoPositionInfo & operator= (

Assigns the values from other to this QGeoPositionInfo.

bool operator== (

Returns true if all of this object's values are the same as those of other.

void removeAttribute (

Removes the specified attribute and its value.

void setAttribute (

Sets the value for attribute to value.

See also:


void setCoordinate (

Sets the coordinate for this position to coordinate.

See also:


void setTimestamp (

Sets the date and time at which this position was reported to timestamp.

The timestamp must be in UTC time.

See also:


QDateTime 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:


Last modified: 2015-03-26

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus