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  · 

Organizer Synchronous API

Introduction

The 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 API

The synchronous API offered by the Organizer Items module is available through the QOrganizerManager class. It consists of two major categories:

  • Organizer Item Manipulation
  • Item Collection Manipulation

Organizer Item Manipulation

The 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 C++ 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 Manipulation

Every 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 C++ 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.

Error Reporting

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

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