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  · 

Category

The Category element represents a category that a Place can be associated with. More...

Inherits QtObject

This type was introduced in Qt Location 5.0.

Properties

Methods

Detailed Description

Categories are used to search for places based on the categories they are associated with. The list of available categories can be obtained from the CategoryModel. The PlaceSearchModel has a categories property that is used to limit the search results to places with the specified categories.

If the Plugin supports it, categories can be created or removed. To create a new category construct a new Category object and set its properties, then invoke the save() method.

 import QtLocation 5.0

 Category {
     id: category

     plugin: myPlugin
     name: "New Category"
     visibility: Category.PrivateVisibility
 }
 ...
 category.save();

To remove a category ensure that the plugin and categoryId properties are set and call the remove() method.

See also CategoryModel.

Property Documentation

category : QPlaceCategory

For details on how to use this property to interface between C++ and QML see "Interfaces between C++ and QML Code".


categoryId : string

This property holds the identifier of the category. The categoryId is a string which uniquely identifies this category within the categories plugin.


icon : PlaceIcon

This property holds the image source associated with the category. To display the icon you can use the Image element.


name : string

This property holds string based name of the category.


plugin : Plugin

This property holds the location based service to which the category belongs.


read-onlystatus : enumeration

This property holds the status of the category. It can be one of:

Category.ReadyNo error occurred during the last operation, further operations may be performed on the category.
Category.SavingThe category is currently being saved, no other operations may be performed until the current operation completes.
Category.RemovingThe category is currently being removed, no other operations can be performed until the current operation completes.
Category.ErrorAn error occurred during the last operation, further operations can still be performed on the category.

visibility : enumeration

This property holds the visibility of the category. It can be one of:

Category.UnspecifiedVisibilityThe visibility of the category is unspecified. If saving a category, the plugin will automatically set a default visibility to the category saved in the backend. This default is dependent on the plugin implementation.
Category.DeviceVisibilityThe category is limited to the current device. The category will not be transferred off of the device.
Category.PrivateVisibilityThe category is private to the current user. The category may be transferred to an online service but is only ever visible to the current user.
Category.PublicVisibilityThe category is public.

Note that visibility does not affect how Places associated with the category are displayed in the user-interface of an application on the device. Instead, it defines the sharing semantics of the category.


Method Documentation

string Category::errorString()

Returns a string description of the error of the last operation. If the last operation completed successfully then the string is empty.


void Category::remove()

This method permanently removes the category from the backend service.


void Category::save()

This method saves the category to the backend service.


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