Home · All Classes · Grouped Classes · Annotated · Functions

QContactDelegate Class Reference

The QContactDelegate class provides drawing of QContactModel items (QContacts). More...

    #include <QContactDelegate>

Inherits QPimDelegate.

Public Functions

Additional Inherited Members


Detailed Description

The QContactDelegate class provides drawing of QContactModel items (QContacts).

By using QContactDelegate, applications dealing with QContacts can achieve a consistent look and feel.

QContacts are drawn with four major sections per item. There are icons on the left and right sides of the rendered item, and top and bottom lines of text. The data drawn is fetched from the model (which is assumed to be a QContactModel), using some additional Qt::ItemDataRole values defined in QContactModel. The following image illustrates a list of QContacts being displayed in a QContactListView using a QContactDelegate:

"List of QContacts"

QContactModel::QContactModelRole defines the additional roles used to draw the items:

RoleData TypeDescription
QContactModel::PortraitRoleQPixmapDrawn vertically centered on the leading side (left for LTR languages) of the item.
Qt::DisplayRoleQStringPlain unformatted text drawn at the top of the item, between any icons.
QContactModel::StatusIconRoleQPixmapOptional. Drawn vertically centered on the trailing side (right for LTR languages) of the item.
QContactModel::SubLabelRoleQStringDrawn as plain text below the label text, if space is available.

The first four contacts shown in the picture above have the following data in the QContactModel:

PortraitRoleDisplayRoleStatusIconRoleSubLabelRole
Pixmap of a personAdam Zucker<empty pixmap>12345
Pixmap of a SIM cardAdam Zucker/h<empty pixmap>12345
Pixmap of a SIM cardAdam Zucker/m<empty pixmap>24685
Pixmap of a personBradley YoungPixmap of a briefcase48759

See also QContact, QContactListView, QContactModel, QPimDelegate, and Pim Library.


Member Function Documentation

QContactDelegate::QContactDelegate ( QObject * parent = 0 )

Constructs a QContactDelegate with the given parent.

QContactDelegate::~QContactDelegate ()   [virtual]

Destroys a QContactDelegate.


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3