| Home · All Classes · Grouped Classes · Annotated · Functions |
The QAppointmentDelegate class provides drawing of QAppointmentModel items (QAppointments). More...
#include <QAppointmentDelegate>
Inherits QAbstractItemDelegate.
The QAppointmentDelegate class provides drawing of QAppointmentModel items (QAppointments).
By using QAppointmentDelegate, applications dealing with QAppointments can achieve a consistent look and feel.
QAppointments are drawn with two sections per item. There are optional icons on the right side of the rendered item, and text on the left. The text and icons are rendered vertically centred within the item if there is enough space. The icons are rendered starting at the top right, in a top-to-bottom, right-to-left fashion.
The following image illustrates a collection of QAppointments being displayed by an application.

It is assumed that the model is a QAppointmentModel. The roles used to draw the items include:
| Role | Data Type | Description |
|---|---|---|
| Qt::DisplayRole | QString | Plain unformatted text drawn on the left of the icon, wrapped to any icons. |
| Qt::DecorationRole | QList<QIcon> | Optional. Drawn on the right side of the item, top-to-bottom, right-to-left |
| Qt::BackgroundColorRole | QColor | Background color of the item. |
The four appointments shown in the picture above have the following data in the model:
| DisplayRole | DecorationRole | BackgroundColorRole |
|---|---|---|
| Status meeting | List with a single icon for recurrence | Blue |
| Lunch at Moe's | List with a single icon for a reminder | Red |
| School play | <empty list> | Red |
| Oslo conf. | List with two icons:
| Red (note that this is the selected appointment, and it is rendered with the current palette's Highlight color) |
See also QAppointment and QAppointmentModel.
Constructs a QAppointmentDelegate with the given parent.
Destroys a QAppointmentDelegate.
| Copyright © 2007 Trolltech | Trademarks | Qtopia 4.3.0 |