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  · 

QOrganizerItemDetail Class

The QOrganizerItemDetail class represents a single, complete detail about an organizer item. More...

 #include <QOrganizerItemDetail>

Inherited by: QOrganizerItemParent.

Public Types

enum DetailType { TypeUndefined, TypeClassification, TypeComment, TypeDescription, ..., TypeTodoProgress }

Public Functions

QOrganizerItemDetail(DetailType detailType = TypeUndefined)
QOrganizerItemDetail(const QOrganizerItemDetail & other)
~QOrganizerItemDetail()
bool hasValue(int field) const
bool isEmpty() const
int key() const
bool removeValue(int field)
void resetKey()
bool setValue(int field, const QVariant & value)
DetailType type() const
QVariant value(int field) const
T value(int field) const
QMap<int, QVariant> values() const
bool operator!=(const QOrganizerItemDetail & other) const
QOrganizerItemDetail & operator=(const QOrganizerItemDetail & other)
bool operator==(const QOrganizerItemDetail & other) const

Related Non-Members

Q_ORGANIZER_EXPORT operator<<(QDebug dbg, const QOrganizerItemDetail & detail)

Detailed Description

The QOrganizerItemDetail class represents a single, complete detail about an organizer item.

All of the information for an organizer item is stored in one or more QOrganizerItemDetail objects.

A detail is a group of logically related bits of data - for example, a QOrganizerItemTimestamp is a single detail that has multiple fields (timestamp of creation, timestamp of last update, etc). Different organizer managers may support different details for different item types, e.g. certain manager may not support the timestamp, while others do.

In general, QOrganizerItemDetail and the built in subclasses (like QOrganizerEventTime) provide convenience and standardized access to values. For example, QOrganizerEventTime provides a convenient API for manipulating a QOrganizerItemDetail to describe the start and end time of an event. Subclasses also provide constants for the names of fields (like QOrganizerEventTime::FieldStartDateTime). Typically the constants for field names start with Field, and the constants for predefined values of a field start with the name of that field (e.g. TypeEvent is a predefined constant for FieldType).

QOrganizerItemDetail objects act like type checked values. In general, you can assign them to and fro and have reasonable behaviour, like the following example.

 QOrganizerItemDescription description;
 description.setDescription("Some descriptive text");
 // description.value(QOrganizerItemDescription::FieldDescription) == "Some descriptive text";
 // description.type() == QOrganizerItemDetail::TypeDescription

 QOrganizerItemDetail detail = description;
 // detail.value(QOrganizerItemDescription::FieldDescription) == "Some descriptive text";
 // detail.type() == QOrganizerItemDetail::TypeDescription

 QOrganizerItemDescription otherDescription = detail;
 // otherDescription.description() == "Some descriptive text";
 // otherDescription.type() == QOrganizerItemDetail::TypeDescription

 QOrganizerItemDisplayLabel label = detail;
 // label is now a default constructed QOrganizerItemDisplayLabel
 // label.value(QOrganizerItemDescription::FieldDescription) is empty
 // label.type() == QOrganizerItemDetail::TypeDisplayLabel

 QOrganizerItemDisplayLabel otherLabel = description;
 // otherLabel is now a default constructed QOrganizerItemDisplayLabel
 // otherLabel.value(QOrganizerItemDescription::FieldDescription) is empty
 // otherLabel.type() == QOrganizerItemDetail::TypeDisplayLabel

See also QOrganizerItem, QOrganizerItemDetailFilter, and QOrganizerItemDetailRangeFilter.

Member Type Documentation

enum QOrganizerItemDetail::DetailType

This enumeration describes the type of the organizer item detail.

ConstantValueDescription
QOrganizerItemDetail::TypeUndefined0This detail is of type undefined.
QOrganizerItemDetail::TypeClassification100This detail is a classification.
QOrganizerItemDetail::TypeComment200This detail is a comment
QOrganizerItemDetail::TypeDescription300This detail is a description.
QOrganizerItemDetail::TypeDisplayLabel400This detail is a display label.
QOrganizerItemDetail::TypeItemType500This detail is an item type.
QOrganizerItemDetail::TypeGuid600This detail is a GUID.
QOrganizerItemDetail::TypeLocation700This detail is a location.
QOrganizerItemDetail::TypeParent800This detail is a parent. Should not be used in parent items.
QOrganizerItemDetail::TypePriority900This detail is a priority.
QOrganizerItemDetail::TypeRecurrence1000This detail is a recurrence. Should not be used in occurrences.
QOrganizerItemDetail::TypeTag1100This detail is a tag.
QOrganizerItemDetail::TypeTimestamp1200This detail is a timestamp.
QOrganizerItemDetail::TypeVersion1300This detail is a version.
QOrganizerItemDetail::TypeReminder1400This detail is a reminder. Should not be directly used.
QOrganizerItemDetail::TypeAudibleReminder1500This detail is an audible reminder.
QOrganizerItemDetail::TypeEmailReminder1600This detail is an email reminder.
QOrganizerItemDetail::TypeVisualReminder1700This detail is a visual reminder.
QOrganizerItemDetail::TypeExtendedDetail1800This detail is an extended detail.
QOrganizerItemDetail::TypeEventAttendee1900This detail is an event attendee.
QOrganizerItemDetail::TypeEventRsvp2000This detail is an event RSVP.
QOrganizerItemDetail::TypeEventTime2100This detail is an event time.
QOrganizerItemDetail::TypeJournalTime2200This detail is a journal time.
QOrganizerItemDetail::TypeTodoTime2400This detail is a TODO time.
QOrganizerItemDetail::TypeTodoProgress2300This detail is a TODO progress.

Member Function Documentation

QOrganizerItemDetail::QOrganizerItemDetail(DetailType detailType = TypeUndefined)

Constructs a new, empty detail of the detailType.

QOrganizerItemDetail::QOrganizerItemDetail(const QOrganizerItemDetail & other)

Constructs a detail that is a copy of other.

QOrganizerItemDetail::~QOrganizerItemDetail()

Frees the memory used by this detail.

bool QOrganizerItemDetail::hasValue(int field) const

Returns true if the value of the given field has been set, or false otherwise.

bool QOrganizerItemDetail::isEmpty() const

Returns true if no values are contained in this detail.

int QOrganizerItemDetail::key() const

Returns the key of this detail.

bool QOrganizerItemDetail::removeValue(int field)

Removes the value stored in this detail for the given field. Returns true if a value was stored for the given field and the removing succeeds, or false otherwise.

void QOrganizerItemDetail::resetKey()

Causes the implicitly-shared detail to be detached from any other copies, and generates a new key for it. This ensures that calling QOrganizerItem::saveDetail() will result in a new detail being saved, rather than another detail being updated.

bool QOrganizerItemDetail::setValue(int field, const QVariant & value)

Sets the value of the given field to be value. If the given value is invalid or null, removes the given field from the detail. Returns true on success, or false otherwise.

See also value().

DetailType QOrganizerItemDetail::type() const

Returns the detail type.

QVariant QOrganizerItemDetail::value(int field) const

Returns the value stored in this detail for the given field. An invalid QVariant is returned if the value of field is not set.

See also setValue().

T QOrganizerItemDetail::value(int field) const

QMap<int, QVariant> QOrganizerItemDetail::values() const

Returns the values stored in this detail as a field-to-value map.

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

Returns true if the values or id of this detail is different to those of the other detail

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

Assigns this detail to other.

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

Compares this detail to other. Returns true if the type and values of other are equal to those of this detail. The keys of each detail are not considered during the comparison, in order to allow details from different organizer items to be compared according to their values.

Related Non-Members

Q_ORGANIZER_EXPORT operator<<(QDebug dbg, const QOrganizerItemDetail & detail)

Streams the detail 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