Home · All Classes · All Functions ·

QNmeaPositionInfoSource Class Reference

The QNmeaPositionInfoSource class provides positional information using a NMEA data source. More...

    #include <QNmeaPositionInfoSource>

Inherits QGeoPositionInfoSource.


Public Types

enum UpdateMode { RealTimeMode, SimulationMode }

Public Functions

QNmeaPositionInfoSource ( UpdateMode updateMode, QObject * parent = 0 )
~QNmeaPositionInfoSource ()
QIODevice * device () const
void setDevice ( QIODevice * device )
UpdateMode updateMode () const

Reimplemented Public Functions

virtual QGeoPositionInfo lastKnownPosition ( bool fromSatellitePositioningMethodsOnly = false ) const
virtual int minimumUpdateInterval () const
virtual void setUpdateInterval ( int msec )
virtual PositioningMethods supportedPositioningMethods () const

Public Slots

virtual void requestUpdate ( int msec = 0 )
virtual void startUpdates ()
virtual void stopUpdates ()

Additional Inherited Members


Detailed Description

The QNmeaPositionInfoSource class provides positional information using a NMEA data source.

NMEA is a commonly used protocol for the specification of one's global position at a certain point in time. The QNmeaPositionInfoSource class reads NMEA data and uses it to provide positional data in the form of QGeoPositionInfo objects.

A QNmeaPositionInfoSource instance operates in either RealTimeMode or SimulationMode. These modes allow NMEA data to be read from either a live source of positional data, or replayed for simulation purposes from previously recorded NMEA data.

Use setUpdateMode() to define the update mode, and setDevice() to set the source of NMEA data.

Use startUpdates() to receive regular position updates through the updated() signal, and stopUpdates() to stop these updates. If you only require updates occasionally, you can call requestUpdate() as required, instead of startUpdates() and stopUpdates().


Member Type Documentation

enum QNmeaPositionInfoSource::UpdateMode

Defines the available update modes.

ConstantValueDescription
QNmeaPositionInfoSource::RealTimeMode1Positional data is read and distributed from the data source as it becomes available. Use this mode if you are using a live source of positional data (for example, a GPS hardware device).
QNmeaPositionInfoSource::SimulationMode2The data and time information in the NMEA source data is used to provide positional updates at the rate at which the data was originally recorded. if the data source contains previously recorded NMEA data and you want to replay the data for simulation purposes.


Member Function Documentation

QNmeaPositionInfoSource::QNmeaPositionInfoSource ( UpdateMode updateMode, QObject * parent = 0 )

Constructs a QNmeaPositionInfoSource instance with the given parent and updateMode.

QNmeaPositionInfoSource::~QNmeaPositionInfoSource ()

Destroys the position source.

QIODevice * QNmeaPositionInfoSource::device () const

Returns the NMEA data source.

See also setDevice().

QGeoPositionInfo QNmeaPositionInfoSource::lastKnownPosition ( bool fromSatellitePositioningMethodsOnly = false ) const   [virtual]

Reimplemented from QGeoPositionInfoSource::lastKnownPosition().

int QNmeaPositionInfoSource::minimumUpdateInterval () const   [virtual]

Reimplemented from QGeoPositionInfoSource::minimumUpdateInterval().

void QNmeaPositionInfoSource::requestUpdate ( int msec = 0 )   [virtual slot]

Reimplemented from QGeoPositionInfoSource::requestUpdate().

void QNmeaPositionInfoSource::setDevice ( QIODevice * device )

Sets the NMEA data source to device. If the device is not open, it will be opened in QIODevice::ReadOnly mode.

The source device can only be set once and must be set before calling startUpdates() or requestUpdate().

Note: The device must emit QIODevice::readyRead() for the source to be notified when data is available for reading.

See also device().

void QNmeaPositionInfoSource::setUpdateInterval ( int msec )   [virtual]

Reimplemented from QGeoPositionInfoSource::setUpdateInterval().

void QNmeaPositionInfoSource::startUpdates ()   [virtual slot]

Reimplemented from QGeoPositionInfoSource::startUpdates().

void QNmeaPositionInfoSource::stopUpdates ()   [virtual slot]

Reimplemented from QGeoPositionInfoSource::stopUpdates().

PositioningMethods QNmeaPositionInfoSource::supportedPositioningMethods () const   [virtual]

Reimplemented from QGeoPositionInfoSource::supportedPositioningMethods().

UpdateMode QNmeaPositionInfoSource::updateMode () const

Returns the update mode. The default mode is QNmeaPositionInfoSource::InvalidMode.


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