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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QLandmarkManager Class Reference

The QLandmarkManager class provides an interface for storage and retrieval of landmarks from a landmark store. More...

 #include <QLandmarkManager>

Inherits QObject.

Public Types

enum Error { NoError, DoesNotExistError, LandmarkDoesNotExistError, CategoryDoesNotExistError, ..., UnknownError }
enum ManagerFeature { ImportExportFeature, NotificationsFeature }
enum SupportLevel { NativeSupport, EmulatedSupport, NoSupport }
enum TransferOperation { ImportOperation, ExportOperation }
enum TransferOption { IncludeCategoryData, ExcludeCategoryData, AttachSingleCategory }

Public Functions

QLandmarkManager ( QObject * parent = 0 )
QLandmarkManager ( const QString & managerName, const QMap<QString, QString> & parameters = 0, QObject * parent = 0 )
virtual ~QLandmarkManager ()
QList<QLandmarkCategory> categories ( const QList<QLandmarkCategoryId> & categoryIds ) const
QList<QLandmarkCategory> categories ( int limit = -1, int offset = 0, const QLandmarkNameSort & nameSort = QLandmarkNameSort() ) const
QLandmarkCategory category ( const QLandmarkCategoryId & categoryId ) const
QList<QLandmarkCategoryId> categoryIds ( int limit = -1, int offset = 0, const QLandmarkNameSort & nameSort = QLandmarkNameSort() ) const
Error error () const
QMap<int, QLandmarkManager::Error> errorMap () const
QString errorString () const
bool exportLandmarks ( QIODevice * device, const QString & format, const QList<QLandmarkId> & landmarkIds = QList<QLandmarkId> (), QLandmarkManager::TransferOption option = IncludeCategoryData ) const
bool exportLandmarks ( const QString & fileName, const QString & format, const QList<QLandmarkId> & landmarkIds = QList<QLandmarkId> (), QLandmarkManager::TransferOption option = IncludeCategoryData ) const
SupportLevel filterSupportLevel ( const QLandmarkFilter & filter ) const
bool importLandmarks ( QIODevice * device, const QString & format = QString(), QLandmarkManager::TransferOption option = IncludeCategoryData, const QLandmarkCategoryId & categoryId = QLandmarkCategoryId() )
bool importLandmarks ( const QString & fileName, const QString & format = QString(), QLandmarkManager::TransferOption option = IncludeCategoryData, const QLandmarkCategoryId & categoryId = QLandmarkCategoryId() )
bool isFeatureSupported ( ManagerFeature feature ) const
bool isReadOnly () const
bool isReadOnly ( const QLandmarkId & landmarkId ) const
bool isReadOnly ( const QLandmarkCategoryId & categoryId ) const
QLandmark landmark ( const QLandmarkId & landmarkId ) const
QList<QLandmarkId> landmarkIds ( const QLandmarkFilter & filter, int limit, int offset, const QList<QLandmarkSortOrder> & sortOrders ) const
QList<QLandmarkId> landmarkIds ( const QLandmarkFilter & filter = QLandmarkFilter(), int limit = -1, int offset = 0, const QLandmarkSortOrder & sortOrder = QLandmarkSortOrder() ) const
QList<QLandmark> landmarks ( const QLandmarkFilter & filter, int limit, int offset, const QList<QLandmarkSortOrder> & sortOrders ) const
QList<QLandmark> landmarks ( const QLandmarkFilter & filter = QLandmarkFilter(), int limit = -1, int offset = 0, const QLandmarkSortOrder & sortOrder = QLandmarkSortOrder() ) const
QList<QLandmark> landmarks ( const QList<QLandmarkId> & landmarkIds ) const
QString managerName () const
QMap<QString, QString> managerParameters () const
QString managerUri () const
int managerVersion () const
bool removeCategory ( const QLandmarkCategoryId & categoryId )
bool removeCategory ( const QLandmarkCategory & category )
bool removeLandmark ( const QLandmarkId & landmarkId )
bool removeLandmark ( const QLandmark & landmark )
bool removeLandmarks ( const QList<QLandmarkId> & landmarkIds )
bool removeLandmarks ( const QList<QLandmark> & landmarks )
bool saveCategory ( QLandmarkCategory * category )
bool saveLandmark ( QLandmark * landmark )
bool saveLandmarks ( QList<QLandmark> * landmarks )
QStringList searchableLandmarkAttributeKeys () const
SupportLevel sortOrderSupportLevel ( const QLandmarkSortOrder & sortOrder ) const
QStringList supportedFormats ( TransferOperation operation ) const
  • 29 public functions inherited from QObject

Signals

void categoriesAdded ( const QList<QLandmarkCategoryId> & categoryIds )
void categoriesChanged ( const QList<QLandmarkCategoryId> & categoryIds )
void categoriesRemoved ( const QList<QLandmarkCategoryId> & categoryIds )
void dataChanged ()
void landmarksAdded ( const QList<QLandmarkId> & landmarkIds )
void landmarksChanged ( const QList<QLandmarkId> & landmarkIds )
void landmarksRemoved ( const QList<QLandmarkId> & landmarkIds )

Static Public Members

const QLatin1Constant Gpx
const QLatin1Constant Kml
const QLatin1Constant Kmz
const QLatin1Constant Lmx
QStringList availableManagers ()
QString buildUri ( const QString & managerName, const QMap<QString, QString> & params, int implementationVersion = -1 )
QLandmarkManager * fromUri ( const QString & storeUri, QObject * parent = 0 )
bool parseUri ( const QString & uri, QString * pManagerName, QMap<QString, QString> * pParams )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QLandmarkManager class provides an interface for storage and retrieval of landmarks from a landmark store.

The QLandmarkManager is the starting class to use when working with landmarks. It effectively represents a landmark datastore and it provides the synchronous operations for the creation, retrieval, updating and deletion of both landmarks and categories. For asynchronous operations use the request classes which use the manager as a parameter. The manager provides notifications whenever landmarks or categories are added, updated or removed.

Each manager is identified by a manager name which typically takes the form of a reverse domain string such as com.nokia.qt.landmarks.engines.sqlite. However every supported platform provides a default manager which may be instantiated without having to provide a name like so:

     QLandmarkManager *landmarkManager = new QLandmarkManager();

Retrieval operations

To retrieve a set of landmarks we provide may provide a QLandmarkFilter, QLandmarkSortOrder and limit and offset as necessary. The QLandmarkFilter defines the criteria for selecting landmarks e.g. a QLandmarkCategoryFilter may be used to choose landmarks that belong to a certain category. A QLandmarkSortOrder order defines how the results should be sorted. (Note that if you wish to sort by distance, you should use a proxmity filter, see QLandmarkProximityFilter). The limit allows specification of the maximum number of items to return and the offset defines the index of the first item. The following demonstrates how to search for the first 100 landmarks belonging to a given category, sorted by name.

         QLandmarkCategoryFilter filter;
         filter.setCategoryId(category.categoryId());

         QLandmarkNameSort nameSort;
         nameSort.setDirection(Qt::AscendingOrder);

         landmarkManager->landmarks(filter, 100, 0, nameSort);

The set of parameters described above are not always necessary as defaults are provided, if we wanted to retrieve all landmarks, then the appropriate call is:

         landmarkManager->landmarks();

Note: Landmark retrieval is potentially a long operation, the synchronous API provided by the manager is subject to blocking. It is generally recommended that the QLandmarkFetchRequest be used because it behaves asynchronously.

Categories may be retrieved in a similar manner:

     QList<QLandmarkCategory> categories = landmarkManager->categories();

Saving and deleting

Saving and deleting landmarks and categories are fairly straightforward. To add a new landmark or category simply instantiate a QLandmark or QLandmarkCategory, set its data fields(e.g name, coordiante etc) and pass a pointer to the appropriate save operation. For example:

     QLandmark monks;
     monks.setName("Monk's cafe");
     //..
     landmarkManager->saveLandmark(&monks);

We pass the landmark by pointer bcause it will be assigned a new QLandmarkId when the function call is done. Saving a landmark with a valid id already set will update the existing landmark.

Removal of landmark may be done as follows:

     landmarkManager->removeLandmark(landmark);

Importing and exporting

Import and exporting are potentially long operations, to perform these operations asynchronously see QLandmarkImportRequest and QLandmarkExportRequest. The simplest way to perform an import is to supply a filename while an export will need both a filename and format.

     landmarkManager->importLandmarks("places.gpx");

     landmarkManager->exportLandmarks("myplaces.gpx",QLandmarkManager::Gpx);

Member Type Documentation

enum QLandmarkManager::Error

Defines the possible errors for the landmark manager.

ConstantValueDescription
QLandmarkManager::NoError0No error occurred
QLandmarkManager::DoesNotExistError1The most recent operation failed due to an item not being found, usually an import file.
QLandmarkManager::LandmarkDoesNotExistError2The most recent operation failed due to a specified landmark not being found.
QLandmarkManager::CategoryDoesNotExistError3The most recent operation faied due to a specified category not being found.
QLandmarkManager::AlreadyExistsError4The most recent operation failed because the specified landmark or category already exists.
QLandmarkManager::LockedError5The most recent operation failed because the datastore specified is currently locked.
QLandmarkManager::PermissionsError6The most recent operation failed because the caller does not have permission to perform the operation.
QLandmarkManager::OutOfMemoryError7The most recent operation failed due to running out of memory.
QLandmarkManager::VersionMismatchError8The most recent operation failed because the backend of the manager is not of the required version.
QLandmarkManager::NotSupportedError9The most recent operation failed because the requested operation is not supported by the manager.
QLandmarkManager::BadArgumentError10The most recent operation failed because one or more of the parameters to the operation were invalid.
QLandmarkManager::InvalidManagerError11The most recent operation failed because the manager failed to initialize correctly and is invalid. This could be due using a manager name that is not recognised/available. A landmark request object will return this error if if is assigned a null manager pointer.
QLandmarkManager::ParsingError12The most recent operation failed because the imported file could not be parsed.
QLandmarkManager::CancelError13The most recent operation failed to complete due to user cancelation.
QLandmarkManager::UnknownError14The most recent operation failed for an unknown reason.

enum QLandmarkManager::ManagerFeature

Defines the possible features the landmark manager can support.

ConstantValueDescription
QLandmarkManager::ImportExportFeature0The manager supports import and/or export operations
QLandmarkManager::NotificationsFeature1The manager will emit notification signals when landmarks/categories have been added/modified/removed from the datastore it manages.

enum QLandmarkManager::SupportLevel

Defines the possible support levels the manager can provide for a given filter or sort order list.

ConstantValueDescription
QLandmarkManager::NativeSupport0The manager natively supports the filter or sort order list.
QLandmarkManager::EmulatedSupport1The manager emulates the behaviour of the filter or sort order list. Emulated behaviour will inherently be slower than a natively supported implementation.
QLandmarkManager::NoSupport2The manager does not support the filter or sort order list at all.

enum QLandmarkManager::TransferOperation

Defines the type of transfer.

ConstantValueDescription
QLandmarkManager::ImportOperation0Landmarks are being copied from a file to the device.
QLandmarkManager::ExportOperation1Landmarks are being copied from the device to a file.

enum QLandmarkManager::TransferOption

Defines the possible options when transferring landmarks during import or export.

ConstantValueDescription
QLandmarkManager::IncludeCategoryData0During an import, category data is included. If an imported category doesn't exist the category is created. If the imported category name matches an existing category name, then the landmark is added to that category. For exports, categories are included in the exported file if the file format allows it.
QLandmarkManager::ExcludeCategoryData1Landmarks are imported or exported without any categories assigned to the landmarks.
QLandmarkManager::AttachSingleCategory2Only relevant for import operations. When landmarks are imported they are all assigned to a given category.

Member Function Documentation

QLandmarkManager::QLandmarkManager ( QObject * parent = 0 )

Constructs a QLandmarkManager. The default manager implementation for the platform will be used.

The parent QObject will be used as the parent of this QLandmarkManager.

QLandmarkManager::QLandmarkManager ( const QString & managerName, const QMap<QString, QString> & parameters = 0, QObject * parent = 0 )

Constructs a QLandmarkManager whose implementation is identified by managerName with the given parameters.

The parent QObject will be used as the parent of this QLandmarkManager.

If an empty managerName is specified, the default manager implementation for the platform will be used.

QLandmarkManager::~QLandmarkManager () [virtual]

Frees the memory used by the QLandmarkManager

QStringList QLandmarkManager::availableManagers () [static]

Returns a list of available manager names that can be used when constructing a QLandmarkManager

QString QLandmarkManager::buildUri ( const QString & managerName, const QMap<QString, QString> & params, int implementationVersion = -1 ) [static]

Returns a URI that completely describes a manager implementation/datastore, and the parameters with which to instantiate the manager, from the given managerName, params and an optional implementationVersion

QList<QLandmarkCategory> QLandmarkManager::categories ( const QList<QLandmarkCategoryId> & categoryIds ) const

Returns a list of categories which match the given categoryIds.

This batch function will set per-input errors in the QLandmarkManager::errorMap();

The QLandmarkManager::error() function will only return QLandmarkManager::NoError if all categories were successfully retrieved.

QList<QLandmarkCategory> QLandmarkManager::categories ( int limit = -1, int offset = 0, const QLandmarkNameSort & nameSort = QLandmarkNameSort() ) const

Returns a list of categories.The limit defines the maximum number of categories to return and the offset defines the index offset of the first category. A limit of -1 means all categories should be returned(a limit of 0 means zero categories are returned). The categories are returned in the order as designated by nameSort.

void QLandmarkManager::categoriesAdded ( const QList<QLandmarkCategoryId> & categoryIds ) [signal]

This signal is emitted when categories (identified by categoryIds) have been added to the datastore managed by this manager. This signal is not emitted if the dataChanged() signal was previously emitted for these changes.

See also categoriesChanged() and categoriesRemoved().

void QLandmarkManager::categoriesChanged ( const QList<QLandmarkCategoryId> & categoryIds ) [signal]

This signal is emitted when categories (identified by categoryIds) have been modified in the datastore managed by this manager. This signal is not emitted if the dataChanged() signal was previously emitted for these changes.

See also categoriesAdded() and categoriesRemoved().

void QLandmarkManager::categoriesRemoved ( const QList<QLandmarkCategoryId> & categoryIds ) [signal]

This signal is emitted when categories (identified by categoryIds) have been removed from the datastore managed by this manager. This signal is not emitted if the dataChanged() signal was previously emitted for these changes.

See also categoriesAdded() and categoriesChanged().

QLandmarkCategory QLandmarkManager::category ( const QLandmarkCategoryId & categoryId ) const

Returns the cateory in the database identified by categoryId.

QList<QLandmarkCategoryId> QLandmarkManager::categoryIds ( int limit = -1, int offset = 0, const QLandmarkNameSort & nameSort = QLandmarkNameSort() ) const

Returns a list of category identifiers. The limit defines the maximum number of ids to return and the offset defines the index offset of the first id. A limit of -1 means ids for all categories should be returned. The identifiers are returned in order as designed by nameSort. Note that a limit of 0 will return zero category ids.

void QLandmarkManager::dataChanged () [signal]

This signal is emitted by the manager if its internal state changes and it is unable to precisely determine the changes which occurred, or if the manager considers the changes to be radical enough to require clients to reload all data. If the signal is emitted, no other signals will be emitted for the associated changes.

Error QLandmarkManager::error () const

Returns the error code of the most recent operation. All functions will modify the error based on whether the operation successfully or not.

QMap<int, QLandmarkManager::Error> QLandmarkManager::errorMap () const

Returns per-input error codes for the most recent operation. This function only returns meaningful information if the most recent operation was a batch operation. The keys in the map correspond to the index of the input list. The error map is only populated for indexes at which an error occurred. Eg If we saved 5 landmarks and an error occurred at index 3, the error map will have only a single key for index 3.

See also error(), categories(), landmarks(), saveLandmarks(), removeCategory(), and removeLandmarks().

QString QLandmarkManager::errorString () const

Returns a short human-readable description of the error that occurred in the most recent operation. The error string is intended to be used by developers and is not suitable for showing to end users.

bool QLandmarkManager::exportLandmarks ( QIODevice * device, const QString & format, const QList<QLandmarkId> & landmarkIds = QList<QLandmarkId> (), QLandmarkManager::TransferOption option = IncludeCategoryData ) const

Writes landmarks to the given device. The landmarks will be written according to the specified format. If landmarkIds is empty, then all landmarks will be exported, otherwise only those landmarks that match landmarkIds will be exported.

The option can be used to control whether categories will be exported or not. Note that the AttachSingleCategory option has no meaning during export and the manager will export as if option was IncludeCategoryData. Also, be aware that some file formats may not support categories at all and for these formats, the option is always treated as if it was ExcludeCategoryData.

Returns true if all specified landmarks were successfully exported, otherwise returns false. It may be possible that only a subset of landmarks are exported.

bool QLandmarkManager::exportLandmarks ( const QString & fileName, const QString & format, const QList<QLandmarkId> & landmarkIds = QList<QLandmarkId> (), QLandmarkManager::TransferOption option = IncludeCategoryData ) const

Convenience function that will write landmarks to fileName in the expected format. Internally a QFile is opened with QIODevice::WriteOnly permissions. If landmarkIds is empty, then all landmarks will be exported, otherwise only those landmarks that match landmarkIds will be exported.

The option can be used to control whether categories will be exported or not. Note that the AttachSingleCategory option has no meaning during export and the manager will export as if option was IncludeCategoryData. Also, be aware that some file formats may not support categories at all and for these formats, the option is always treated as if it was ExcludeCategoryData.

Returns true if all specified landmarks were successfully exported, otherwise returns false. It may be possible that only a subset of landmarks are exported.

SupportLevel QLandmarkManager::filterSupportLevel ( const QLandmarkFilter & filter ) const

Returns the support level the manager provides for the given filter. For the case of intersection and union filters, whether the elements will be individually processed is dependent on the particular manager implementation.

QLandmarkManager * QLandmarkManager::fromUri ( const QString & storeUri, QObject * parent = 0 ) [static]

Constructs a QLandmarkManager whose implementation, store and parameters are specified in the given storeUri, and whose parent object is parent.

bool QLandmarkManager::importLandmarks ( QIODevice * device, const QString & format = QString(), QLandmarkManager::TransferOption option = IncludeCategoryData, const QLandmarkCategoryId & categoryId = QLandmarkCategoryId() )

Reads landmarks from the given device and saves them. The data from the device is expected to adhere to the provided format. If no format is provided, the manager tries to auto detect the format.

The option can be used to control whether categories in the imported file will be added during the import. If the AttachSingleCategory option is used, then all the landmarks in the import file are assigned to the category identified by categoryId, in all other circumstances categoryId is ignored. If categoryId doesn't exist when using AttachSingleCategory, QLandmarkManager::CategoryDoesNotExistError is set. Note that some file formats may not support categories at all.

Returns true if all landmarks could be imported, otherwise returns false.

bool QLandmarkManager::importLandmarks ( const QString & fileName, const QString & format = QString(), QLandmarkManager::TransferOption option = IncludeCategoryData, const QLandmarkCategoryId & categoryId = QLandmarkCategoryId() )

Convenience function that will read landmarks from fileName in the expected format. If no format is provided, the manager tries to auto detect the format. Internally a QFile is opened with QIODevice::ReadOnly permissions.

The option can be used to control whether categories in the imported file will be added during the import. If the AttachSingleCategory option is used, then all the landmarks in the import file are assigned to the category identified by categoryId, in all other circumstances categoryId is ignored. If categoryId doesn't exist when using AttachSingleCategory, QLandmarkManager::CategoryDoesNotExistError is set. Note that some file formats may not support categories at all.

Returns true if all landmarks could be imported, otherwise returns false.

bool QLandmarkManager::isFeatureSupported ( ManagerFeature feature ) const

Returns whether the manager supports the given feature.

bool QLandmarkManager::isReadOnly () const

Returns true if the manager is entirely read-only. Meaning landmarks and categories cannot be added, modified or removed.

bool QLandmarkManager::isReadOnly ( const QLandmarkId & landmarkId ) const

Returns true if the landmark identified by landmarkId considered read-only by the manager.

If the landmarkId does not refer to an existing landmark, it is considered writable unless the manager is exclusively read-only.

bool QLandmarkManager::isReadOnly ( const QLandmarkCategoryId & categoryId ) const

Returns true if the category identified by categoryId is considered read-only by the manager.

If categoryId does not refer to an existing category, it is considered writable unless the manager is exclusively read-only.

QLandmark QLandmarkManager::landmark ( const QLandmarkId & landmarkId ) const

Returns the landmark in the database identified by landmarkId

QList<QLandmarkId> QLandmarkManager::landmarkIds ( const QLandmarkFilter & filter, int limit, int offset, const QList<QLandmarkSortOrder> & sortOrders ) const

Returns a list of landmark identifiers which match the given filter and are sorted according to the given sortOrders. The limit defines the maximum number of landmark ids to return and the offset defines the index offset of the first landmark id. A limit of -1 means that ids of all matching landmarks should be returned. Note that a limit of 0 will return zero landmark ids.

QList<QLandmarkId> QLandmarkManager::landmarkIds ( const QLandmarkFilter & filter = QLandmarkFilter(), int limit = -1, int offset = 0, const QLandmarkSortOrder & sortOrder = QLandmarkSortOrder() ) const

Convenience function to returns a list of landmark identifiers which match the given filter and are sorted according to the given sortOrder. The limit defines the maximum number of landmark ids to return and the offset defines the index offset of the first landmark id. A limit of -1 means that ids of all matching landmarks should be returned. Note that a limit of 0 will return zero landmark ids.

QList<QLandmark> QLandmarkManager::landmarks ( const QLandmarkFilter & filter, int limit, int offset, const QList<QLandmarkSortOrder> & sortOrders ) const

Returns a list of landmarks which match the given filter and are sorted according to the sortOrders. The limit defines the maximum number of landmarks to return and the offset defines the index offset of the first landmark. A limit of -1 means all matching landmarks should be returned.

QList<QLandmark> QLandmarkManager::landmarks ( const QLandmarkFilter & filter = QLandmarkFilter(), int limit = -1, int offset = 0, const QLandmarkSortOrder & sortOrder = QLandmarkSortOrder() ) const

Returns a list of landmarks which match the given filter and are sorted according to the sortOrder. The limit defines the maximum number of landmarks to return and the offset defines the index offset of the first landmark. A limit of -1 means all matching landmarks should be returned and that a limit of 0 will return zero landmarks.

QList<QLandmark> QLandmarkManager::landmarks ( const QList<QLandmarkId> & landmarkIds ) const

Returns a list of landmarks which match the given landmarkIds.

This batch function will set per-input errors in the QLandmarkManager::errorMap().

The QLandmarkManager::error() function will only return QLandmarkManager::NoError if all landmarks were successfully retrieved.

void QLandmarkManager::landmarksAdded ( const QList<QLandmarkId> & landmarkIds ) [signal]

This signal is emitted when landmarks (identified by landmarkIds) have been added to the datastore managed by this manager. This signal is not emitted if the dataChanged() signal was previously emitted for these changes.

See also landmarksChanged() and landmarksRemoved().

void QLandmarkManager::landmarksChanged ( const QList<QLandmarkId> & landmarkIds ) [signal]

This signal is emitted when landmarks (identified by landmarkIds) have been modified in the datastore managed by this manager. This signal is not emitted if the dataChanged() signal was previously emitted for these changes. Note that removal of a category will not trigger a landmarksChanged signal for landmarks belonging to that category.

See also landmarksAdded() and landmarksRemoved().

void QLandmarkManager::landmarksRemoved ( const QList<QLandmarkId> & landmarkIds ) [signal]

This signal is emitted when landmarks (identified by landmarkIds) have been removed from the datastore managed by this manager. This signal is not emitted if the dataChanged() signal was previously emitted for these changes.

See also landmarksAdded() and landmarksChanged().

QString QLandmarkManager::managerName () const

Returns the manager name for this QLandmarkManager.

The manager name usually takes the format of a reverse domain string. An example of a manager name is com.nokia.qt.landmarks.engines.sqlite

QMap<QString, QString> QLandmarkManager::managerParameters () const

Return the parameters relevant to the creation of this QLandmarkManager.

The parameters may be viewed as a set of key-value pairs. Each manager may have a different set of parameters depending upon its backend implementation.

QString QLandmarkManager::managerUri () const

Return the uri describing this QLandmarkManager, consisting of the manager name and any parameters.

int QLandmarkManager::managerVersion () const

Returns the engine backend implementation version number.

bool QLandmarkManager::parseUri ( const QString & uri, QString * pManagerName, QMap<QString, QString> * pParams ) [static]

Splits the given uri into the manager name and parameters that it describes, and places the information into the memory addressed by pManagerName and pParams respectively. Returns true if uri could be split successfully, otherwise returns false

bool QLandmarkManager::removeCategory ( const QLandmarkCategoryId & categoryId )

Remove the category identified by categoryId from the database.

Returns true if the category was removed successfully, otherwise returnse false.

bool QLandmarkManager::removeCategory ( const QLandmarkCategory & category )

Remove the given category from the database

Returns true if the category was removed successfully, otherwise returnse false.

bool QLandmarkManager::removeLandmark ( const QLandmarkId & landmarkId )

Remove the landmark identified by landmarkId from the database.

Returns true if the landmark was removed successfully, otherwise returnse false.

bool QLandmarkManager::removeLandmark ( const QLandmark & landmark )

Removes the landmark from the database.

Returns true if the landmark was removed successfully, otherwise returns false.

bool QLandmarkManager::removeLandmarks ( const QList<QLandmarkId> & landmarkIds )

Removes every landmark whose identifier is contained in the list of landmarkIds. Returns true if all landmarks were removed successfully, otherwise false.

This batch function will set per-input errors in the QLandmarkManager::errorMap().

The QLandmarkManager::error() function will only return QLandmarkManager::NoError if all landmarks were removed successfully.

See also QLandmarkManager::removeLandmark().

bool QLandmarkManager::removeLandmarks ( const QList<QLandmark> & landmarks )

Convenience function to remove the given landmarks from the database. Returns true if all landmarks were removed successfully, otherwise false.

This batch function will set per input errors in the QLandmarkManager::errorMap().

The QLandmarkManager::error() function will only return QLandmarkManager::NoError if all landmarks were removed successfully.

See also QLandmarkManager::removeLandmark().

bool QLandmarkManager::saveCategory ( QLandmarkCategory * category )

Adds the given category to the database if category has a default-constructed identifier, or an identifier with the manager URI set to the URI of this manager and an empty id.

If the manager URI of the identifier of the category is neither empty nor equal to the URI of this manager, or the id member of the identifier is not empty, but does not exist in the manager, the operation will fail and calling error() will return QLandmarkManager::CategoryDoesNotExistError.

Alternatively, the function will update the existing category in the database if category has a non-empty id and currently exists within the database.

Returns false on failure or true on success. On successful save of a category with an invalid id, it will be assigned a valid id and have its manager URI set to the URI of this manager.

bool QLandmarkManager::saveLandmark ( QLandmark * landmark )

Adds the given landmark to the database if landmark has a default-constructed identifer, or an identifier with the manager URI set to the URI of this manager and an empty id.

If the manager URI of the identifier of the landmark is neither empty nor equal to the URI of this manager, or the id member of the identifier is not empty, but does not exist in the manager, the operation will fail and calling error() will return QLandmarkManager::LandmarkDoesNotExistError.

Alternatively, the function will update the existing landmark in the database if landmark has a non-empty id and currently exists within the database.

Returns false on failure or true on success. On successful save of a landmark with an empty id, it will be assigned a valid id and have its manager URI set to the URI of this manager.

bool QLandmarkManager::saveLandmarks ( QList<QLandmark> * landmarks )

Adds the list of landmarks to the database. Returns true if the landmarks were saved successfully, otherwise returns false.

This function will set per-input errors in the QLandmarkManager::errorMap().

The QLandmarkManager::error() function will only return QLandmarkManager::NoError if all landmarks were saved successfully.

For each new landmark that was successfully saved, a landmark identifier is assigned to that landmark.

QStringList QLandmarkManager::searchableLandmarkAttributeKeys () const

Returns a list of landmark attribute keys that may be used in a QLandmarkAttributeFilter.

SupportLevel QLandmarkManager::sortOrderSupportLevel ( const QLandmarkSortOrder & sortOrder ) const

Returns the support level the manager provides for the given sortOrder.

QStringList QLandmarkManager::supportedFormats ( TransferOperation operation ) const

Returns the file formats supported for the given transfer operation. ie import or export.

Member Variable Documentation

const QLatin1Constant QLandmarkManager::Gpx

The format constant to define using the gpx format in the import and export functions.

See also importLandmarks() and exportLandmarks().

const QLatin1Constant QLandmarkManager::Kml

The format constant to define using the kml format in the import and export functions.

See also importLandmarks() and exportLandmarks().

const QLatin1Constant QLandmarkManager::Kmz

The format constant to define using the kmz format in the import and export functions.

See also importLandmarks() and exportLandmarks().

const QLatin1Constant QLandmarkManager::Lmx

The format constant to define using the lmx format in the import and export functions.

See also importLandmarks() and exportLandmarks().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 88
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 39
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le Qt Quarterly au hasard

Logo

Poppler : afficher des fichiers PDF avec Qt

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.1
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