Home · All Classes · All Functions ·

QGeoPositionInfo Class Reference

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

    #include <QGeoPositionInfo>

Public Types

enum Property { Heading, GroundSpeed, VerticalSpeed, MagneticVariation, HorizontalAccuracy, VerticalAccuracy }

Public Functions

QGeoPositionInfo ()
QGeoPositionInfo ( const QGeoCoordinate & coordinate, const QDateTime & dateTime )
QGeoPositionInfo ( const QGeoPositionInfo & other )
~QGeoPositionInfo ()
QGeoCoordinate coordinate () const
QDateTime dateTime () const
bool hasProperty ( Property property ) const
bool isValid () const
qreal property ( Property property ) const
void removeProperty ( Property property )
void setCoordinate ( const QGeoCoordinate & coordinate )
void setDateTime ( const QDateTime & dateTime )
void setProperty ( Property property, qreal value )
bool operator!= ( const QGeoPositionInfo & other ) const
QGeoPositionInfo & operator= ( const QGeoPositionInfo & other )
bool operator== ( const QGeoPositionInfo & other ) const

Related Non-Members

QDataStream & operator<< ( QDataStream & stream, const QGeoPositionInfo & info )
QDataStream & operator>> ( QDataStream & stream, QGeoPositionInfo & info )

Detailed Description

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.


Member Type Documentation

enum QGeoPositionInfo::Property

Defines the properties for positional information.

ConstantValueDescription
QGeoPositionInfo::Heading0The bearing to true north, in degrees.
QGeoPositionInfo::GroundSpeed1The ground speed, in metres/sec.
QGeoPositionInfo::VerticalSpeed2The vertical speed, in metres/sec.
QGeoPositionInfo::MagneticVariation3The 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::HorizontalAccuracy4The accuracy of the provided latitude-longitude value, in metres.
QGeoPositionInfo::VerticalAccuracy5The accuracy of the provided altitude value, in metres.


Member Function Documentation

QGeoPositionInfo::QGeoPositionInfo ()

Creates an invalid QGeoPositionInfo object.

See also isValid().

QGeoPositionInfo::QGeoPositionInfo ( const QGeoCoordinate & coordinate, const QDateTime & dateTime )

Creates a QGeoPositionInfo for the given coordinate and dateTime.

QGeoPositionInfo::QGeoPositionInfo ( const QGeoPositionInfo & other )

Creates a QGeoPositionInfo with the values of other.

QGeoPositionInfo::~QGeoPositionInfo ()

Destroys a QGeoPositionInfo object.

QGeoCoordinate QGeoPositionInfo::coordinate () const

Returns the coordinate for this position.

Returns an invalid coordinate if no coordinate has been set.

See also setCoordinate().

QDateTime QGeoPositionInfo::dateTime () 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 setDateTime().

bool QGeoPositionInfo::hasProperty ( Property property ) const

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

bool QGeoPositionInfo::isValid () const

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

See also QGeoCoordinate::isValid() and QDateTime::isValid().

qreal QGeoPositionInfo::property ( Property property ) const

Returns the value of the specified property as a qreal value.

Returns -1 if the value has not been set.

See also hasProperty() and setProperty().

void QGeoPositionInfo::removeProperty ( Property property )

Removes the specified property and its value.

void QGeoPositionInfo::setCoordinate ( const QGeoCoordinate & coordinate )

Sets the coordinate for this position to coordinate.

See also coordinate().

void QGeoPositionInfo::setDateTime ( const QDateTime & dateTime )

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

The dateTime must be in UTC time.

See also dateTime().

void QGeoPositionInfo::setProperty ( Property property, qreal value )

Sets the value for property to value.

See also property().

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, const QGeoPositionInfo & info )

Writes the given info to the specified stream.

See also Format of the QDataStream Operators.

QDataStream & operator>> ( QDataStream & stream, QGeoPositionInfo & info )

Reads a coordinate from the specified stream into the given info.

See also Format of the QDataStream Operators.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0 (Technology Preview)