qdesigner_internal::ActionGroupDelegate Class Reference

Inheritance diagram for qdesigner_internal::ActionGroupDelegate:

Inheritance graph
[legend]
Collaboration diagram for qdesigner_internal::ActionGroupDelegate:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 102 of file actioneditor.cpp.

Public Member Functions

 ActionGroupDelegate (QObject *parent)
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual void drawFocus (QPainter *, const QStyleOptionViewItem &, const QRect &) const


Constructor & Destructor Documentation

qdesigner_internal::ActionGroupDelegate::ActionGroupDelegate ( QObject parent  )  [inline]

Definition at line 105 of file actioneditor.cpp.

00106         : QItemDelegate(parent) {}


Member Function Documentation

virtual void qdesigner_internal::ActionGroupDelegate::paint ( QPainter painter,
const QStyleOptionViewItem option,
const QModelIndex index 
) const [inline, virtual]

Renders the delegate using the given painter and style option for the item specified by index.

When reimplementing this function in a subclass, you should update the area held by the option's {QStyleOption::rect}{rect} variable, using the option's {QStyleOption::state}{state} variable to determine the state of the item to be displayed, and adjust the way it is painted accordingly.

For example, a selected item may need to be displayed differently to unselected items, as shown in the following code:

itemviews/pixelator/pixeldelegate.cpp QStyle::State_Selected else

After painting, you should ensure that the painter is returned to its the state it was supplied in when this function was called. For example, it may be useful to call QPainter::save() before painting and QPainter::restore() afterwards.

See also:
QStyle::State

Reimplemented from QItemDelegate.

Definition at line 108 of file actioneditor.cpp.

References QPainter::fillRect(), QPalette::highlight(), index, QItemDelegate::paint(), QStyleOption::palette, QStyleOption::rect, QStyleOption::state, and QStyle::State_Selected.

00109     {
00110         if (option.state & QStyle::State_Selected)
00111             painter->fillRect(option.rect, option.palette.highlight());
00112 
00113         QItemDelegate::paint(painter, option, index);
00114     }

Here is the call graph for this function:

virtual void qdesigner_internal::ActionGroupDelegate::drawFocus ( QPainter ,
const QStyleOptionViewItem ,
const QRect  
) const [inline, virtual]

Renders the region within the rectangle specified by rect, indicating that it has the focus, using the given painter and style option.

Reimplemented from QItemDelegate.

Definition at line 116 of file actioneditor.cpp.

00116 {}


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 20:41:06 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1