QGeoSatelliteInfoSource ClassThe QGeoSatelliteInfoSource class is an abstract base class for the distribution of satellite information updates. More... #include <QGeoSatelliteInfoSource> Inherits: QObject. This class was introduced in Qt Location 5.0. Public Types
Properties
Public Functions
Public Slots
Signals
Static Public Members
Additional Inherited Members
Detailed DescriptionThe QGeoSatelliteInfoSource class is an abstract base class for the distribution of satellite information updates. The static function QGeoSatelliteInfoSource::createDefaultSource() creates a default satellite data source that is appropriate for the platform, if one is available. Otherwise, available QGeoPositionInfoSourceFactory plugins will be checked for one that has a satellite data source available. Call startUpdates() and stopUpdates() to start and stop regular updates, or requestUpdate() to request a single update. When an update is available, satellitesInViewUpdated() and/or satellitesInUseUpdated() will be emitted. If regular satellite updates are required, setUpdateInterval() can be used to specify how often these updates should be emitted. If no interval is specified, updates are simply provided whenever they are available. For example: // Emit updates every 10 seconds if available QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createDefaultSource(0); if (source) source->setUpdateInterval(10000); To remove an update interval that was previously set, call setUpdateInterval() with a value of 0. Note that the satellite source may have a minimum value requirement for update intervals, as returned by minimumUpdateInterval(). Warning: On Windows CE it is not possible to detect if a device is GPS enabled. The default satellite source on a Windows CE device without GPS support will never provide any satellite data. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QGeoSatelliteInfoSource::AccessError | 0 | The connection setup to the remote positioning backend failed because the application lacked the required privileges. |
QGeoSatelliteInfoSource::ClosedError | 1 | The remote satellite backend closed the connection, which happens for example in case the user is switching location services to off. This object becomes invalid and should be deleted. A new satellite source can be created by calling createDefaultSource() later on. |
QGeoSatelliteInfoSource::UnknownSourceError | -1 | An unidentified error occurred. |
This property holds this property holds the minimum time (in milliseconds) required to retrieve a satellite update.
This is the minimum value accepted by setUpdateInterval() and requestUpdate().
Access functions:
virtual int | minimumUpdateInterval() const = 0 |
This property holds this property holds the requested interval in milliseconds between each update.
If the update interval is not set (or is set to 0) the source will provide updates as often as necessary.
If the update interval is set, the source will provide updates at an interval as close to the requested interval as possible. If the requested interval is less than the minimumUpdateInterval(), the minimum interval is used instead.
Changes to the update interval will happen as soon as is practical, however the time the change takes may vary between implementations. Whether or not the elapsed time from the previous interval is counted as part of the new interval is also implementation dependent.
The default value for this property is 0.
Note: Subclass implementations must call the base implementation of setUpdateInterval() so that updateInterval() returns the correct value.
Access functions:
int | updateInterval() const |
virtual void | setUpdateInterval(int msec) |
Creates a satellite source with the specified parent.
Destroys the satellite source.
Returns a list of available source plugins, including the default system backend if one is available.
Creates and returns a source with the specified parent that reads from the system's default source of satellite update information, or the highest priority available plugin.
Returns 0 if the system has no default position source, no valid plugins could be found or the user does not have the permission to access the satellite data.
Creates and returns a source with the given parent, by loading the plugin named sourceName.
Returns 0 if the plugin cannot be found.
This signal is emitted after an error occurred. The satelliteError parameter describes the type of error that occurred.
Emitted if requestUpdate() was called and the current satellite information could not be retrieved within the specified timeout.
Attempts to get the current satellite information and emit satellitesInViewUpdated() and satellitesInUseUpdated() with this information. If the current position cannot be found within the given timeout (in milliseconds) or if timeout is less than the value returned by minimumUpdateInterval(), requestTimeout() is emitted.
If the timeout is zero, the timeout defaults to a reasonable timeout period as appropriate for the source.
This does nothing if another update request is in progress. However it can be called even if startUpdates() has already been called and regular updates are in progress.
If startUpdates() or requestUpdate() is called, this signal is emitted when an update is available on the number of satellites that are currently in use.
These are the satellites that are used to get a "fix" - that is, those used to determine the current position.
The satellites parameter holds the satellites currently in use.
If startUpdates() or requestUpdate() is called, this signal is emitted when an update is available on the satellites that are currently in view.
The satellites parameter holds the satellites currently in view.
Starts emitting updates at regular intervals. The updates will be provided whenever new satellite information becomes available.
See also satellitesInViewUpdated() and satellitesInUseUpdated().
Stops emitting updates at regular intervals.