Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QGeoServiceProvider Class

The QGeoServiceProvider class aggregates access to services which provide geographical information. More...

 #include <QGeoServiceProvider>

Inherits: QObject.

This class was introduced in Qt Location 5.0.

Public Types

enum Error { NoError, NotSupportedError, UnknownParameterError, MissingRequiredParameterError, ConnectionError }
enum GeocodingFeature { NoGeocodingFeatures, OnlineGeocodingFeature, OfflineGeocodingFeature, ReverseGeocodingFeature, LocalizedGeocodingFeature, AnyGeocodingFeatures }
flags GeocodingFeatures
enum MappingFeature { NoMappingFeatures, OnlineMappingFeature, OfflineMappingFeature, LocalizedMappingFeature, AnyMappingFeatures }
flags MappingFeatures
enum PlacesFeature { NoPlacesFeatures, OnlinePlacesFeature, OfflinePlacesFeature, SavePlaceFeature, ..., AnyPlacesFeatures }
flags PlacesFeatures
enum RoutingFeature { NoRoutingFeatures, OnlineRoutingFeature, OfflineRoutingFeature, LocalizedRoutingFeature, ..., AnyRoutingFeatures }
flags RoutingFeatures

Public Functions

QGeoServiceProvider(const QString & providerName, const QMap<QString, QVariant> & parameters = ( QMap<QString, QVariant)
~QGeoServiceProvider()
Error error() const
QString errorString() const
GeocodingFeatures geocodingFeatures() const
QGeocodingManager * geocodingManager() const
MappingFeatures mappingFeatures() const
QGeoMappingManager * mappingManager() const
QPlaceManager * placeManager() const
PlacesFeatures placesFeatures() const
RoutingFeatures routingFeatures() const
QGeoRoutingManager * routingManager() const
void setAllowExperimental(bool allow)
void setLocale(const QLocale & locale)
void setParameters(const QMap<QString, QVariant> & parameters)
  • 31 public functions inherited from QObject

Static Public Members

QStringList availableServiceProviders()
  • 11 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 2 signal inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QGeoServiceProvider class aggregates access to services which provide geographical information.

The Maps and Navigation API allows people to access various kinds of geographical information, including functionality to perform geocoding, routing and the display of maps. The QGeoServiceProvider aggregates the access to a set of these services that are provided by a single vendor.

It is possible to mix and match service providers for the various domains, so that a geocoding manager from one service provider can be used with a geographic routing manager from another service provider.

This is not recommended unless the client is able to verify that the data provided by the different services are compatible, as differences in the underlying data sets could cause serious incongruences between the services.

Subclasses of QGeoServiceProvider guarantee that the different services that they provide are interoperable.

At this point only the Nokia Services plugin is packaged with Qt, which is accessible using the provider name "nokia".

Member Type Documentation

enum QGeoServiceProvider::Error

Describes an error related to the loading and setup of a service provider plugin.

ConstantValueDescription
QGeoServiceProvider::NoError0No error has occurred.
QGeoServiceProvider::NotSupportedError1The plugin does not support this functionality.
QGeoServiceProvider::UnknownParameterError2The plugin did not recognize one of the parameters it was given.
QGeoServiceProvider::MissingRequiredParameterError3The plugin did not find one of the parameters it was expecting.
QGeoServiceProvider::ConnectionError4The plugin could not connect to its backend service or database.

enum QGeoServiceProvider::GeocodingFeature
flags QGeoServiceProvider::GeocodingFeatures

The GeocodingFeatures type is a typedef for QFlags<GeocodingFeature>. It stores an OR combination of GeocodingFeature values.

enum QGeoServiceProvider::MappingFeature
flags QGeoServiceProvider::MappingFeatures

The MappingFeatures type is a typedef for QFlags<MappingFeature>. It stores an OR combination of MappingFeature values.

enum QGeoServiceProvider::PlacesFeature
flags QGeoServiceProvider::PlacesFeatures

The PlacesFeatures type is a typedef for QFlags<PlacesFeature>. It stores an OR combination of PlacesFeature values.

enum QGeoServiceProvider::RoutingFeature
flags QGeoServiceProvider::RoutingFeatures

The RoutingFeatures type is a typedef for QFlags<RoutingFeature>. It stores an OR combination of RoutingFeature values.

Member Function Documentation

QGeoServiceProvider::QGeoServiceProvider(const QString & providerName, const QMap<QString, QVariant> & parameters = ( QMap<QString, QVariant)

QGeoServiceProvider::~QGeoServiceProvider()

Destroys the service provider object.

QStringList QGeoServiceProvider::availableServiceProviders() [static]

Returns a list of names of the available service providers, for use with the QGeoServiceProvider constructors.

Error QGeoServiceProvider::error() const

Returns an error code describing the error which occurred during the last operation that was performed by this class.

QString QGeoServiceProvider::errorString() const

Returns a string describing the error which occurred during the last operation that was performed by this class.

GeocodingFeatures QGeoServiceProvider::geocodingFeatures() const

QGeocodingManager * QGeoServiceProvider::geocodingManager() const

Returns the QGeocodingManager made available by the service provider.

This function will return 0 if the service provider does not provide any geocoding services.

This function will attempt to construct a QGeocodingManager instance when it is called for the first time. If the attempt is successful the QGeocodingManager will be cached, otherwise each call of this function will attempt to construct a QGeocodingManager instance until the construction is successful.

The QGeocodingManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeocodingManager.

MappingFeatures QGeoServiceProvider::mappingFeatures() const

QGeoMappingManager * QGeoServiceProvider::mappingManager() const

Returns the QGeoMappingManager made available by the service provider.

This function will return 0 if the service provider does not provide any mapping services.

This function will attempt to construct a QGeoMappingManager instance when it is called for the first time. If the attempt is successful the QGeoMappingManager will be cached, otherwise each call of this function will attempt to construct a QGeoMappingManager instance until the construction is successful.

The QGeoMappingManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeoMappingManager.

QPlaceManager * QGeoServiceProvider::placeManager() const

Returns the QPlaceManager made available by the service provider.

This function will return 0 if the service provider does not provide any place searching services.

This function will attempt to construct a QPlaceManager instance when it is called for the first time. If the attempt is successful the QPlaceManager will be cached, otherwise each call of this function will attempt to construct a QPlace instance until the construction is successful.

The QGeoPlaceManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QPlaceManager.

PlacesFeatures QGeoServiceProvider::placesFeatures() const

RoutingFeatures QGeoServiceProvider::routingFeatures() const

QGeoRoutingManager * QGeoServiceProvider::routingManager() const

Returns the QGeoRoutingManager made available by the service provider.

This function will return 0 if the service provider does not provide any geographic routing services.

This function will attempt to construct a QGeoRoutingManager instance when it is called for the first time. If the attempt is successful the QGeoRoutingManager will be cached, otherwise each call of this function will attempt to construct a QGeoRoutingManager instance until the construction is successful.

The QGeoRoutingManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeoRoutingManager.

void QGeoServiceProvider::setAllowExperimental(bool allow)

Sets whether experimental plugins are considered when locating the correct plugin library for this service provider.

Important: this will destroy any existing managers held by this service provider instance. You should be sure not to attempt to use any pointers that you have previously retrieved after calling this method.

void QGeoServiceProvider::setLocale(const QLocale & locale)

Sets the locale used by this service provider. If the relevant features (see LocalizedMappingFeature etc), this will change the languages, units and other locale-specific attributes of the provider's data.

void QGeoServiceProvider::setParameters(const QMap<QString, QVariant> & parameters)

Sets the parameters used to construct individual manager classes for this service provider.

Important: this will destroy any existing managers held by this service provider instance. You should be sure not to attempt to use any pointers that you have previously retrieved after calling this method.

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 5.0-snapshot
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 !
 
 
 
 
Partenaires

Hébergement Web