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  · 

QOrganizerCollection Class

The QOrganizerCollection class represents a collection of items in a manager. More...

 #include <QOrganizerCollection>

Public Types

enum MetaDataKey { KeyName, KeyDescription, KeyColor, KeyImage, KeyExtended }

Public Functions

QOrganizerCollection()
QOrganizerCollection(const QOrganizerCollection & other)
~QOrganizerCollection()
QVariant extendedMetaData(const QString & key) const
QOrganizerCollectionId id() const
QVariant metaData(MetaDataKey key) const
QMap<QOrganizerCollection::MetaDataKey, QVariant> metaData() const
void setExtendedMetaData(const QString & key, const QVariant & value)
void setId(const QOrganizerCollectionId & id)
void setMetaData(MetaDataKey key, const QVariant & value)
void setMetaData(const QMap<QOrganizerCollection::MetaDataKey, QVariant> & metaData)
bool operator!=(const QOrganizerCollection & other) const
QOrganizerCollection & operator=(const QOrganizerCollection & other)
bool operator==(const QOrganizerCollection & other) const

Related Non-Members

Q_ORGANIZER_EXPORT operator<<(QDebug dbg, const QOrganizerCollection & collection)

Detailed Description

The QOrganizerCollection class represents a collection of items in a manager.

A collection has an ID and optionally some metadata, and contains zero or more items. Each different manager will have different requirements before a collection may be saved in it. Some managers do not allow collections to be saved at all, while others may require a collection to have some minimal amount of meta data defined in it prior to save. For example, most managers require a valid value for the QOrganizerCollection::KeyName meta data key to be set prior to save.

Every QOrganizerItem is contained within a collection when stored in a manager. To save an item in a collection, the client should call QOrganizerItem::setCollectionId() on the item, passing in the ID of the destination collection as the argument, and then save the item in the manager. To move an item from one collection to another, the client must fetch the item from the manager, set the collection ID in the item to the ID of the collection to which the client wishes the item to be moved, and then resave the item in the manager. That is, the collection which an item is part of is treated as a property of the item.

Member Type Documentation

enum QOrganizerCollection::MetaDataKey

This enumeration describes the key of the organizer collection metadata.

ConstantValueDescription
QOrganizerCollection::KeyName0This metadata describes the name of the collection.
QOrganizerCollection::KeyDescription1This metadata gives a description of the collection.
QOrganizerCollection::KeyColor2This metadata describes the color of the collection.
QOrganizerCollection::KeyImage3This metadata describes the image of the collection.
QOrganizerCollection::KeyExtended4This is an extened metadata, which is stored as a QVariantMap.

Member Function Documentation

QOrganizerCollection::QOrganizerCollection()

Constructs a new collection.

QOrganizerCollection::QOrganizerCollection(const QOrganizerCollection & other)

Constructs a new copy of the other collection.

QOrganizerCollection::~QOrganizerCollection()

Cleans up any memory in use by the collection.

QVariant QOrganizerCollection::extendedMetaData(const QString & key) const

Returns the value of extended metadata with the given key.

See also setExtendedMetaData().

QOrganizerCollectionId QOrganizerCollection::id() const

Returns the ID of the collection.

See also setId().

QVariant QOrganizerCollection::metaData(MetaDataKey key) const

Returns the meta data of the collection for the given key.

See also setMetaData().

QMap<QOrganizerCollection::MetaDataKey, QVariant> QOrganizerCollection::metaData() const

Returns the meta data of the collection.

void QOrganizerCollection::setExtendedMetaData(const QString & key, const QVariant & value)

Sets the value of the extended metadata with the given key to value.

See also extendedMetaData().

void QOrganizerCollection::setId(const QOrganizerCollectionId & id)

Sets the ID of the collection to id.

If the ID is set to a null (default-constructed) ID, saving the collection will cause the manager to save the collection as a new collection.

See also id().

void QOrganizerCollection::setMetaData(MetaDataKey key, const QVariant & value)

Sets the meta data of the collection for the given key to the given value.

See also metaData().

void QOrganizerCollection::setMetaData(const QMap<QOrganizerCollection::MetaDataKey, QVariant> & metaData)

Sets the metadata of the collection to be metaData.

bool QOrganizerCollection::operator!=(const QOrganizerCollection & other) const

Returns true if the collection is not the same as the other collection.

QOrganizerCollection & QOrganizerCollection::operator=(const QOrganizerCollection & other)

Assigns this collection to be equal to the other collection.

bool QOrganizerCollection::operator==(const QOrganizerCollection & other) const

Returns true if the collection is the same as that of the other collection, false if either the ID or any of the stored metadata are not the same.

Related Non-Members

Q_ORGANIZER_EXPORT operator<<(QDebug dbg, const QOrganizerCollection & collection)

Streams the collection to the given debug stream dbg, and returns the stream.

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