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 |
- 7 public functions inherited from QGeoPositionInfoSource
Public Slots
| virtual void | requestUpdate ( int msec = 0 ) |
| virtual void | startUpdates () |
| virtual void | stopUpdates () |
- 3 public slots inherited from QGeoPositionInfoSource
Protected Functions
| virtual bool | parsePosInfoFromNmeaData ( const char * data, int size, QGeoPositionInfo * posInfo, bool * hasFix ) |
Additional Inherited Members
- 2 properties inherited from QGeoPositionInfoSource
- 2 signals inherited from QGeoPositionInfoSource
- 1 static public member inherited from QGeoPositionInfoSource
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.
The source of NMEA data is set with setDevice().
Use startUpdates() to start receiving regular position updates and stopUpdates() to stop these updates. If you only require updates occasionally, you can call requestUpdate() to request a single update.
In both cases the position information is received via the positionUpdated() signal and the last known position can be accessed with lastKnownPosition().