QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlCheckableHeaderView Class Reference

A subclass of QHeaderView with a checkbox in the first column. More...

Inheritance diagram for QtlCheckableHeaderView:

Signals

void checkStateChanged (Qt::CheckState state)
 Emitted when the state of the checkbox in the header changes. More...
 

Public Member Functions

 QtlCheckableHeaderView (QWidget *parent=0)
 Constructor. More...
 
Qt::CheckState checkState () const
 Get the state of the checkbox in the header. More...
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 Process a mouse-press event. More...
 
virtual void paintSection (QPainter *painter, const QRect &rect, int logicalIndex) const Q_DECL_OVERRIDE
 Paint the section specified by the given logicalIndex, using the given painter and rect. More...
 
void processCheckStateChanged ()
 Process a change of check state in the header. More...
 

Private Member Functions

QRect checkBoxRect (const QPoint &reference=QPoint()) const
 Compute the position and size of the checkbox in the header. More...
 
void updateAllRows ()
 Update the checkboxes in all rows, based on the checkbox in the header. More...
 

Private Attributes

Qt::CheckState _checkState
 Current state of the checkbox in header. More...
 
bool _forceCheck
 Force either checked or unchecked on next paint. More...
 

Detailed Description

A subclass of QHeaderView with a checkbox in the first column.

The checkbox in the header allows to select / deselect all checkboxes in the first column. The header view is always horizontal (top row).

Constructor & Destructor Documentation

◆ QtlCheckableHeaderView()

QtlCheckableHeaderView::QtlCheckableHeaderView ( QWidget *  parent = 0)
explicit

Constructor.

Parameters
[in]parentOptional parent widget.

Member Function Documentation

◆ checkState()

Qt::CheckState QtlCheckableHeaderView::checkState ( ) const
inline

Get the state of the checkbox in the header.

Returns
The state of the checkbox in the header.

◆ checkStateChanged

void QtlCheckableHeaderView::checkStateChanged ( Qt::CheckState  state)
signal

Emitted when the state of the checkbox in the header changes.

Parameters
[in]stateNew state of the checkbox.

◆ processCheckStateChanged()

void QtlCheckableHeaderView::processCheckStateChanged ( )
protected

Process a change of check state in the header.

◆ paintSection()

void QtlCheckableHeaderView::paintSection ( QPainter *  painter,
const QRect &  rect,
int  logicalIndex 
) const
protectedvirtual

Paint the section specified by the given logicalIndex, using the given painter and rect.

Reimplemented from QHeaderView

Parameters
[in]painterPainter to use.
[in]rectArea to paint.
[in]logicalIndexSection index, 0 being the first section where the checkbox is located.

◆ mousePressEvent()

void QtlCheckableHeaderView::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Process a mouse-press event.

Reimplemented from QHeaderView

Parameters
[in]eventThe mouse event.

◆ checkBoxRect()

QRect QtlCheckableHeaderView::checkBoxRect ( const QPoint &  reference = QPoint()) const
private

Compute the position and size of the checkbox in the header.

Parameters
[in]referenceOptional reference point. If non-zero, the returned rectangle is set relatively to this point.
Returns
Position and size of the checkbox in the header.

◆ updateAllRows()

void QtlCheckableHeaderView::updateAllRows ( )
private

Update the checkboxes in all rows, based on the checkbox in the header.

Member Data Documentation

◆ _checkState

Qt::CheckState QtlCheckableHeaderView::_checkState
mutableprivate

Current state of the checkbox in header.

◆ _forceCheck

bool QtlCheckableHeaderView::_forceCheck
mutableprivate

Force either checked or unchecked on next paint.


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