Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QContactDelegate class provides drawing of QContactModel items (QContacts). More...
#include <QContactDelegate>
Inherits QPimDelegate.
Inherited by CallContactDelegate.
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:
QContactModel::QContactModelRole defines the additional roles used to draw the items:
Role | Data Type | Description |
---|---|---|
QContactModel::PortraitRole | QPixmap | Drawn vertically centered on the leading side (left for LTR languages) of the item. |
Qt::DisplayRole | QString | Plain unformatted text drawn at the top of the item, between any icons. |
QContactModel::StatusIconRole | QPixmap | Optional. Drawn vertically centered on the trailing side (right for LTR languages) of the item. |
QContactModel::SubLabelRole | QString | Drawn 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:
PortraitRole | DisplayRole | StatusIconRole | SubLabelRole |
---|---|---|---|
Pixmap of a person | Adam Zucker | <empty pixmap> | 12345 |
Pixmap of a SIM card | Adam Zucker/h | <empty pixmap> | 12345 |
Pixmap of a SIM card | Adam Zucker/m | <empty pixmap> | 24685 |
Pixmap of a person | Bradley Young | Pixmap of a briefcase | 48759 |
See also QContact, QContactListView, QContactModel, QPimDelegate, and Pim Library.
Constructs a QContactDelegate with the given parent.
Destroys a QContactDelegate.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |