ctkCheckableHeaderView Class Reference

#include <Libs/Widgets/ctkCheckableHeaderView.h>

List of all members.

Public Slots

void setCheckState (int section, Qt::CheckState checkState)
void toggleCheckState (int section)

Public Member Functions

bool checkState (int section, Qt::CheckState &checkState) const
Qt::CheckState checkState (int section) const
 ctkCheckableHeaderView (Qt::Orientation orient, QWidget *parent=0)
virtual bool eventFilter (QObject *object, QEvent *e)
bool isCheckable (int section) const
bool propagateToItems () const
virtual void setModel (QAbstractItemModel *model)
void setPropagateToItems (bool propagate)
virtual void setRootIndex (const QModelIndex &index)
virtual ~ctkCheckableHeaderView ()

Protected Member Functions

virtual void initStyleSectionOption (QStyleOptionHeader *option, int section, QRect rect) const
bool isPointInCheckBox (int section, QPoint pos) const
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
virtual void updateHeaders (int first, int last)

Properties

bool propagateToItems

Detailed Description

ctkCheckableHeaderView is a QHeaderView that can display a checkbox for any header section. If propageteToItems, the check state of the header section is set to all items in the header row/column of the QAbstractItemModel ctkCheckableHeaderView also supports row/column sorting.

Definition at line 71 of file ctkCheckableHeaderView.h.


Constructor & Destructor Documentation

ctkCheckableHeaderView::ctkCheckableHeaderView ( Qt::Orientation  orient,
QWidget *  parent = 0 
)

Definition at line 111 of file ctkCheckableHeaderView.cpp.

ctkCheckableHeaderView::~ctkCheckableHeaderView (  )  [virtual]

Definition at line 125 of file ctkCheckableHeaderView.cpp.


Member Function Documentation

bool ctkCheckableHeaderView::checkState ( int  section,
Qt::CheckState &  checkState 
) const

Utility function that returns the checkState of the section. One can access the same value through the model: model->headerData(orientation, section, Qt::CheckStateRole)

Definition at line 430 of file ctkCheckableHeaderView.cpp.

Qt::CheckState ctkCheckableHeaderView::checkState ( int  section  )  const

Utility function that returns the checkState of the section. One can access the same value through the model: model->headerData(orientation, section, Qt::CheckStateRole)

Definition at line 423 of file ctkCheckableHeaderView.cpp.

bool ctkCheckableHeaderView::eventFilter ( QObject *  object,
QEvent *  e 
) [virtual]

Used to listen for focus in/out events.

Parameters:
object The object receiving the event.
e Event specific data.
Returns:
True if the event should be filtered out.

Definition at line 130 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::initStyleSectionOption ( QStyleOptionHeader *  option,
int  section,
QRect  rect 
) const [protected, virtual]

Definition at line 511 of file ctkCheckableHeaderView.cpp.

bool ctkCheckableHeaderView::isCheckable ( int  section  )  const

A section is checkable if its CheckStateRole data is non null. One can access the same value through the model: model->headerData(orientation, section, Qt::CheckStateRole).isEmpty()

Definition at line 417 of file ctkCheckableHeaderView.cpp.

bool ctkCheckableHeaderView::isPointInCheckBox ( int  section,
QPoint  pos 
) const [protected]

Definition at line 485 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 439 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 462 of file ctkCheckableHeaderView.cpp.

bool ctkCheckableHeaderView::propagateToItems (  )  const
void ctkCheckableHeaderView::setCheckState ( int  section,
Qt::CheckState  checkState 
) [slot]

Warning, setting the check state automatically set the header section checkable

Definition at line 253 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::setModel ( QAbstractItemModel *  model  )  [virtual]

Definition at line 142 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::setPropagateToItems ( bool  propagate  ) 

If true, the items check states in a row/column are synchronized with the check state of the corresponding header section.

Definition at line 210 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::setRootIndex ( const QModelIndex &  index  )  [virtual]

Definition at line 203 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::toggleCheckState ( int  section  )  [slot]

if the check state is PartiallyChecked, the section becomes Checked

Definition at line 240 of file ctkCheckableHeaderView.cpp.

void ctkCheckableHeaderView::updateHeaders ( int  first,
int  last 
) [protected, virtual]

Definition at line 279 of file ctkCheckableHeaderView.cpp.


Property Documentation

bool ctkCheckableHeaderView::propagateToItems [read, write]

Definition at line 73 of file ctkCheckableHeaderView.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1