Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QContactItem Class Reference
[QtMessagingModule, QtPimModule, QtTelephonyModule, QtUiModule]

The QContactItem class provides a QStandardItem based class representing a QContact. More...

    #include <QContactItem>

Inherits QStandardItem.

Public Functions

Additional Inherited Members


Detailed Description

The QContactItem class provides a QStandardItem based class representing a QContact.

By using QContactItem (and QContactItemModel), views of arbitrary collections of contacts can be created. This can be useful when choosing arbitrary contacts (for example, selecting recipients for a message), or when you would like to manually filter a QContactModel.

This class is designed to operate with QContactDelegate.

See also QContactItemModel and QStandardItem.


Member Function Documentation

QContactItem::QContactItem ()

Create an empty QContactItem, with no label, portrait, secondary label, or status icon.

QContactItem::QContactItem ( const QContact & contact, const QString & subLabel = QString(), const QPixmap & statusIcon = QPixmap() )

Create a QContactItem based on the supplied contact and secondary label subLabel, and secondary decoration statusIcon.

The contact's portrait will be used as the decoration for this item, and if QContactItem is being rendered by QContactDelegate, the additional subLabel and statusIcon will also be rendered.

If subLabel is not empty, the supplied string will be rendered with QContactDelegate underneath the contact label. If subLabel is empty, a default value will be generated from contact in a similar manner to QContactModel::SubLabelRole.

If it is valid, the statusIcon pixmap will be rendered on the trailing edge of the item.

QContactItem::~QContactItem ()

Destroys the QContactItem.

QString QContactItem::label () const

Returns the label displayed by this item.

See also setLabel() and subLabel().

QPixmap QContactItem::portrait () const

Return the contact's portrait (QContactModel::PortraitRole) as a pixmap.

See also setPortrait().

void QContactItem::setLabel ( const QString & text )

Set the text displayed by this item to text. This corresponds to Qt::DisplayRole and QContactModel::LabelRole.

See also label().

void QContactItem::setPortrait ( const QPixmap & image )

Set the pixmap displayed by this item to image. This corresponds to Qt::DecorationRole and QContactModel::PortraitRole.

See also portrait().

void QContactItem::setStatusIcon ( const QPixmap & image )

Set the additional status icon displayed by this item to image. This corresponds to QContactModel::StatusIconRole and Qtopia::AdditionalDecorationRole.

See also statusIcon().

void QContactItem::setSubLabel ( const QString & text )

Set the secondary label displayed by this item to text. This corresponds to QContactModel::SubLabelRole

See also subLabel().

QPixmap QContactItem::statusIcon () const

Return the contact's additional status icon (QContactModel::StatusIconRole) as a pixmap.

See also setStatusIcon().

QString QContactItem::subLabel () const

Returns the secondary label displayed by this item.

See also setSubLabel() and label().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3