Home · All Classes · All Functions ·

QContactTag Class Reference

The QContactTag class contains a tag associated with a contact. More...

    #include <QContactTag>

Inherits QContactDetail.


Public Functions

void setTag ( const QString & tag )
QString tag () const

Static Public Members

const QLatin1Constant DefinitionName
const QLatin1Constant FieldTag

Detailed Description

The QContactTag class contains a tag associated with a contact.

Typically the tags associated with a contact will be distinct, although this is usually only enforced when the contact is saved in the manager.

Here is an example of retrieving all the tags for a contact:

            QSet<QString> tags;
            foreach(const QContactTag& tag, contact.details<QContactTag>()) {
                 tags.insert(tag.tag());
            }

Here is an example of checking for a specific tag value:

            if (contact.details<QContactTag>(QContactTag::FieldTag, "MyTag").count() > 0) {
                // Do something with it
            }

Member Function Documentation

void QContactTag::setTag ( const QString & tag )

Sets the tag associated with a contact which is stored in this detail to tag.

See also tag().

QString QContactTag::tag () const

Returns the tag associated with a contact which is stored in this detail.

See also setTag().


Member Variable Documentation

const QLatin1Constant QContactTag::DefinitionName

The string constant for the definition name of QContactTag details.

const QLatin1Constant QContactTag::FieldTag

The field key constant for the value containing the tag.

See also tag() and setTag().


Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.2