Home · All Classes · Grouped Classes · Annotated · Functions

QAppointmentDelegate Class Reference

The QAppointmentDelegate class provides drawing of QAppointmentModel items (QAppointments). More...

    #include <QAppointmentDelegate>

Inherits QAbstractItemDelegate.

Public Functions

Additional Inherited Members


Detailed Description

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.

"View of QAppointments"

It is assumed that the model is a QAppointmentModel. The roles used to draw the items include:

RoleData TypeDescription
Qt::DisplayRoleQStringPlain unformatted text drawn on the left of the icon, wrapped to any icons.
Qt::DecorationRoleQList<QIcon>Optional. Drawn on the right side of the item, top-to-bottom, right-to-left
Qt::BackgroundColorRoleQColorBackground color of the item.

The four appointments shown in the picture above have the following data in the model:

DisplayRoleDecorationRoleBackgroundColorRole
Status meetingList with a single icon for recurrenceBlue
Lunch at Moe'sList with a single icon for a reminderRed
School play<empty list>Red
Oslo conf.List with two icons:
  • a recurrence icon
  • a timezone icon
Red (note that this is the selected appointment, and it is rendered with the current palette's Highlight color)

See also QAppointment and QAppointmentModel.


Member Function Documentation

QAppointmentDelegate::QAppointmentDelegate ( QObject * parent = 0 )

Constructs a QAppointmentDelegate with the given parent.

QAppointmentDelegate::~QAppointmentDelegate ()   [virtual]

Destroys a QAppointmentDelegate.


Copyright © 2007 Trolltech Trademarks
Qtopia 4.3.0