Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

Blokkal::Ui::CheckBoxDelegate Class Reference

#include <checkboxdelegate.h>

Inheritance diagram for Blokkal::Ui::CheckBoxDelegate:

List of all members.


Public Member Functions

 CheckBoxDelegate (QObject *parent=0)

Protected Member Functions

virtual QRect checkBoxRect (const QStyleOptionViewItem &option, const QModelIndex &index) const
int checkBoxSize (const QFontMetrics &metrics) const
virtual bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
void layoutPlainItem (const QStyleOptionViewItem &option, const QModelIndex &index, QRect &textRect) const
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setView (Blokkal::Ui::CheckBoxView *view)
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual void stateChanged (QAbstractItemModel *model, const QModelIndex &index, Qt::CheckState newState)
Blokkal::Ui::CheckBoxViewview (void) const

Friends

class CheckBoxView

Detailed Description

short A delegate that paints the checkbox to a custom location

A delegate that paints the checkbox to a custom location

Author:
Martin Mueller <orvio@orvio.de>

Definition at line 37 of file checkboxdelegate.h.


Constructor & Destructor Documentation

Blokkal::Ui::CheckBoxDelegate::CheckBoxDelegate ( QObject *  parent = 0  ) 

Constructor

Definition at line 41 of file checkboxdelegate.cpp.


Member Function Documentation

QRect Blokkal::Ui::CheckBoxDelegate::checkBoxRect ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [protected, virtual]

Returns the position of the check box for index The rect is invalid if a checkbox is not appropriate for index.

Returns:
the position of the check box for index

Definition at line 66 of file checkboxdelegate.cpp.

int Blokkal::Ui::CheckBoxDelegate::checkBoxSize ( const QFontMetrics &  metrics  )  const [protected]

Returns the size of the the checkbox

Returns:
the size of the the checkbox

Definition at line 61 of file checkboxdelegate.cpp.

bool Blokkal::Ui::CheckBoxDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) [protected, virtual]

Reimplemented to use the virtual method checkBoxRect() instead of the check() as in the QItemDelegate implementation

Definition at line 123 of file checkboxdelegate.cpp.

void Blokkal::Ui::CheckBoxDelegate::layoutPlainItem ( const QStyleOptionViewItem &  option,
const QModelIndex &  index,
QRect &  textRect 
) const [protected]

This method does the layout for a simple item with a checkbox (if appropriate for index ) and a text that may be drawn into textRect

Definition at line 177 of file checkboxdelegate.cpp.

void Blokkal::Ui::CheckBoxDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [protected, virtual]

Paints the checkbox in the rect returned by checkBoxRect(), if that rect is valid.

Definition at line 97 of file checkboxdelegate.cpp.

void Blokkal::Ui::CheckBoxDelegate::setView ( Blokkal::Ui::CheckBoxView view  )  [protected]

Sets the view for this delegate to view

Definition at line 51 of file checkboxdelegate.cpp.

QSize Blokkal::Ui::CheckBoxDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [protected, virtual]

Returns the size hint. This is the size hint for the checkbox. If the rect returned by checkBoxRect is invalid, then this method will return a 0 size.

Definition at line 113 of file checkboxdelegate.cpp.

void Blokkal::Ui::CheckBoxDelegate::stateChanged ( QAbstractItemModel *  model,
const QModelIndex &  index,
Qt::CheckState  newState 
) [protected, virtual]

This method is called when the checkstate of index has changed to newState. The default implementation does nothing.

Definition at line 200 of file checkboxdelegate.cpp.

Blokkal::Ui::CheckBoxView * Blokkal::Ui::CheckBoxDelegate::view ( void   )  const [protected]

Returns a pointer to the view.

Returns:
a pointer to the view

Definition at line 56 of file checkboxdelegate.cpp.


The documentation for this class was generated from the following files: