A subclass of QHeaderView with a checkbox in the first column. More...
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... | |
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).
|
explicit |
Constructor.
[in] | parent | Optional parent widget. |
|
inline |
Get the state of the checkbox in the header.
|
signal |
Emitted when the state of the checkbox in the header changes.
[in] | state | New state of the checkbox. |
|
protected |
Process a change of check state in the header.
|
protectedvirtual |
Paint the section specified by the given logicalIndex, using the given painter and rect.
Reimplemented from QHeaderView
[in] | painter | Painter to use. |
[in] | rect | Area to paint. |
[in] | logicalIndex | Section index, 0 being the first section where the checkbox is located. |
|
protectedvirtual |
Process a mouse-press event.
Reimplemented from QHeaderView
[in] | event | The mouse event. |
|
private |
Compute the position and size of the checkbox in the header.
[in] | reference | Optional reference point. If non-zero, the returned rectangle is set relatively to this point. |
|
private |
Update the checkboxes in all rows, based on the checkbox in the header.
|
mutableprivate |
Current state of the checkbox in header.
|
mutableprivate |
Force either checked or unchecked on next paint.