QGeoPositionInfoSource Class ReferenceThe QGeoPositionInfoSource class is an abstract base class for the distribution of positional updates. More... #include <QGeoPositionInfoSource> Inherits QObject. Inherited by QNmeaPositionInfoSource. Public Types
Properties
Public Functions
Public Slots
Signals
Static Public Members
Additional Inherited Members
Detailed DescriptionThe QGeoPositionInfoSource class is an abstract base class for the distribution of positional updates. The static function QGeoPositionInfoSource::createDefaultSource() creates a default position source that is appropriate for the platform, if one is available. Otherwise, QGeoPositionInfoSource can be subclassed to create an appropriate custom source of position data. Users of a QGeoPositionInfoSource subclass can request the current position using requestUpdate(), or start and stop regular position updates using startUpdates() and stopUpdates(). When an update is available, positionUpdate() is emitted. The last known position can be accessed with lastUpdate(). If regular position 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
QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource();
source->setUpdateInterval(10000);
To remove an update interval that was previously set, call setUpdateInterval() with a value of 0. Note that the position source may have a minimum value requirement for update intervals, as returned by minimumIntervalForType(). Warning: On Windows CE it is not possible to detect if a device is GPS enabled. The default position source on a Windows CE device without GPS support will never provide any position data. Member Type Documentation
flags QGeoPositionInfoSource::PositioningMethods |
Constant | Value | Description |
---|---|---|
QGeoPositionInfoSource::SatellitePositioningMethods | 0x000000ff | Satellite-based positioning methods such as GPS. |
QGeoPositionInfoSource::NonSatellitePositioningMethods | 0xffffff00 | Other positioning methods. |
QGeoPositionInfoSource::AllPositioningMethods | 0xffffffff | A flag that matches all positioning methods. |
The PositioningMethods type is a typedef for QFlags<PositioningMethod>. It stores an OR combination of PositioningMethod values.
This property holds this property holds the minimum time (in milliseconds) required to retrieve a position 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.
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 position source with the specified parent.
Destroys the position source.
Creates and returns a position source with the given parent that reads from the system's default sources of location data.
Returns 0 if the system has no default position source.
Returns an update containing the last known position, or a null update if none is available.
If fromSatellitePositioningMethodsOnly is true, this returns the last known position received from a satellite positioning method; if none is available, a null update is returned.
If startUpdates() or requestUpdate() is called, this signal is emitted when an update becomes available.
The update value holds the value of the new update.
Returns the positioning methods set by setPreferredPositioningMethods().
See also setPreferredPositioningMethods().
Emitted if requestUpdate() was called and the current position could not be retrieved within the specified timeout.
Attempts to get the current position and emit positionUpdated() 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 the source uses multiple positioning methods, it tries to gets the current position from the most accurate positioning method within the given timeout.
Sets the preferred positioning methods for this source to methods.
If methods includes a method that is not supported by the source, the unsupported method will be ignored.
Note: When reimplementing this method, subclasses must call the base method implementation to ensure preferredPositioningMethods() returns the correct value.
See also preferredPositioningMethods() and supportedPositioningMethods().
Starts emitting updates at regular intervals as specified by setUpdateInterval().
If setUpdateInterval() has not been called, the source will emit updates as soon as they become available.
Stops emitting updates at regular intervals.
Returns the positioning methods available to this source.
See also setPreferredPositioningMethods().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtmobility-1.0-tp | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com