QContactTag Class

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

Header: #include <QContactTag>
Inherits: QContactDetail

Public Types

enum TagField { FieldTag }

Public Functions

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

Static Public Members

const DetailType Type
QContactFilter match(const QString &subString)

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>().count() > 0) {
      // Do something with it
  }

Member Type Documentation

enum QContactTag::TagField

This enumeration defines the fields supported by QContactTag.

ConstantValueDescription
QContactTag::FieldTag0The value stored in this field contains the tag.

See also tag() and setTag().

Member Function Documentation

[static] QContactFilter QContactTag::match(const QString &subString)

Returns a filter suitable for finding contacts which have a tag which contains the specified subString.

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 DetailType QContactTag::Type

The enum constant for the type identifier of QContactTag details.