QGeoPositionInfo

#include <QtLocationSubset/QGeoPositionInfo>

The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time.

QtLocationSubset
Since:

1.0

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 ()
QGeoPositionInfo &operator= (const QGeoPositionInfo &other)
booloperator== (const QGeoPositionInfo &other) const
booloperator!= (const QGeoPositionInfo &other) const
boolisValid () const
voidsetTimestamp (const QDateTime &timestamp)
QDateTimetimestamp () const
voidsetCoordinate (const QGeoCoordinate &coordinate)
QGeoCoordinatecoordinate () const
voidsetAttribute (Attribute attribute, qreal value)
qrealattribute (Attribute attribute) const
voidremoveAttribute (Attribute attribute)
boolhasAttribute (Attribute attribute) const

Public Types

Attribute

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.

Direction
GroundSpeed
VerticalSpeed
MagneticVariation
HorizontalAccuracy
VerticalAccuracy

Public Functions

QGeoPositionInfo ()

Creates an invalid QGeoPositionInfo object.

See:

isValid()

QGeoPositionInfo (

Creates a QGeoPositionInfo for the given coordinate and timestamp.

QGeoPositionInfo (

Creates a QGeoPositionInfo with the values of other.

~QGeoPositionInfo ()

Destructor.

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.

bool operator!= (

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

bool isValid ()

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

See:

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

void setTimestamp (

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

The timestamp must be in UTC time.

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.

void setCoordinate (

Sets the coordinate for this position to coordinate.

QGeoCoordinate coordinate ()

Returns the coordinate for this position.

Returns an invalid coordinate if no coordinate has been set.

void setAttribute (

Sets the value for attribute to value.

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.

void removeAttribute (

Removes the specified attribute and its value.

bool hasAttribute (

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