Mantid
|
This class subclasses and overwrites QHeaderView methods to enable checkboxes to exist in the table header. More...
#include <CheckboxHeader.h>
Signals | |
void | toggled (bool checked) |
Public Member Functions | |
CheckboxHeader (Qt::Orientation orientation, QWidget *parent=nullptr) | |
Override QHeaderView constructor. More... | |
void | setChecked (bool checked) |
Has the user checked the checkbox in the header? More... | |
Protected Member Functions | |
void | mousePressEvent (QMouseEvent *event) override |
Set the checkbox to checked when it is clicked. More... | |
void | paintSection (QPainter *painter, const QRect &rect, int logicalIndex) const override |
Overrides QHeaderView allowing checkbox functionality in the first column of the table. More... | |
Private Member Functions | |
QRect | checkBoxRect (const QRect &sourceRect) const |
The area around the checkbox. More... | |
Private Attributes | |
bool | m_checked |
The state of the checkbox in the column header. More... | |
This class subclasses and overwrites QHeaderView methods to enable checkboxes to exist in the table header.
Definition at line 25 of file CheckboxHeader.h.
|
explicit |
Override QHeaderView constructor.
Constructor.
orientation | :: The orientation (horizontal or vertical) of the header. |
parent | :: The table to apply the header to. |
Definition at line 17 of file CheckboxHeader.cpp.
|
private |
The area around the checkbox.
Definition at line 77 of file CheckboxHeader.cpp.
References checkBoxRect().
Referenced by checkBoxRect(), and paintSection().
|
overrideprotected |
Set the checkbox to checked when it is clicked.
Set the checkbox to checked if clicked, otherwise unchecked.
event | :: The mouse event the user performs. |
Definition at line 67 of file CheckboxHeader.cpp.
|
overrideprotected |
Overrides QHeaderView allowing checkbox functionality in the first column of the table.
Implements the checkbox functionality into the first column of the table.
painter | :: Paints the specific widget. |
rect | :: The area to paint. |
logicalIndex | :: The column in the table. |
Definition at line 41 of file CheckboxHeader.cpp.
References checkBoxRect(), m_checked, and Mantid::Geometry::rect.
void MantidQt::MantidWidgets::CheckboxHeader::setChecked | ( | bool | checked | ) |
Has the user checked the checkbox in the header?
checked | :: True if user has checked the checkbox in the header. |
Definition at line 27 of file CheckboxHeader.cpp.
|
signal |
Referenced by mousePressEvent(), and setChecked().
|
private |
The state of the checkbox in the column header.
Definition at line 47 of file CheckboxHeader.h.
Referenced by mousePressEvent(), paintSection(), and setChecked().