Organizer Synchronous APIIntroductionThe Organizer Items Synchronous API enables a client to synchronously fetch, update, or remove item data from an item manager. A synchronous API is of most use to clients who wish to perform simple requests where user interface responsiveness is not critical. Synchronous calls to an item manager will block until they are completed, and therefore should not be performed in the GUI thread (especially if the manager is a frontend to an online service or long-latency datastore). The main advantage of the synchronous API is its simplicity and convenience. Most operations which may be performed using the synchronous API may also be performed using the asynchronous API. It is recommended for most applications that the asynchronous API be used where possible. Using The APIThe synchronous API offered by the Organizer Items module is available through the QOrganizerManager class. It consists of three major categories:
Organizer Item ManipulationThe most common type of operation that clients will perform involves retrieval or modification of organizer items. For in-depth information about item manipulation, please refer to the main Organizer API page. The QOrganizerManager class provides API for accessing the IDs of items which are stored in the manager: The synchronous, singular item manipulation functions offered by the QOrganizerManager class are: The synchronous, batch item manipulation functions offered by the QOrganizerManager class are:
Item Collection ManipulationEvery item is saved in a collection in a manager. Each collection has various properties which, if the manager supports such operations, may be modified by clients. For in-depth information about collections, please refer to the main Organizer API page. The synchronous API offers the following functions to manipulate collections:
It also offers a convenience function which returns a collection with a given collection id. Schema ManipulationThe schema supported by a engine is the list of detail definitions which are supported by the engine. For in-depth information about the schema, please refer to the main Qt Organizer Schema page. The synchronous API offers several functions to retrieve or modify the schema supported by an engine. Engines which support these types of operations must report to clients that they support the QOrganizerManager::MutableDefinitions feature.
Error ReportingWhen a synchronous operation fails, clients need to be able to retrieve error information associated with that synchronous operation. You can call the QOrganizerManager::error() function directly after a failing synchronous operation to determine why it failed. For some synchronous operations (for example, batch save or remove operations) it is possible that multiple errors may occur during the operation. In those cases, clients can call QOrganizerManager::errorMap() to retrieve a map of input index to error, which will be filled by the function as required. The QOrganizerManager::error() function will report the overall operation error. |
Publicité
Best OfActualités les plus luesSemaine
Mois
Année
Le blog Digia au hasardCréer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut CuvelierLe blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.
CommunautéRessources
Liens utilesContact
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.2 | |
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