包含复选框的表头
更多...
#include <CheckBoxHeader.h>
|
|
void | sigCheckStateChanged (int index, Qt::CheckState state) |
| |
|
|
| CCheckBoxHeader (Qt::Orientation orientation, QWidget *parent=nullptr) |
| |
| void | SetCheckable (int index, bool checkable, Qt::CheckState state=Qt::Unchecked) |
| | 设置是否显示复选框
|
| |
| bool | isCheckable (int index) const |
| |
| void | SetCheckState (int index, Qt::CheckState state) |
| | 设置表头复选框状态
|
| |
| Qt::CheckState | GetCheckState (int index) const |
| |
|
| void | paintSection (QPainter *painter, const QRect &rect, int logicalIndex) const override |
| |
| void | mousePressEvent (QMouseEvent *event) override |
| |
|
| QRect | CheckboxRect (const QRect §ionRect) const |
| |
| void | DrawText (QPainter *painter, const QRect &rect, const QString &text, Qt::Alignment alignment) const |
| |
| void | DrawCheckBox (QPainter *painter, const QRect &rect, Qt::CheckState state, bool enabled) const |
| |
包含复选框的表头
- 如果模型是 QStandardItemModel ,则会根据 QStandardItem::isCheckable() 来判断是否显示复选框
- 如果模型不是 QStandardItemModel ,则使用 SetCheckState() 来决定是否显示复选框
在文件 CheckBoxHeader.h 第 18 行定义.
◆ CheckboxRect()
| QRect CCheckBoxHeader::CheckboxRect |
( |
const QRect & |
sectionRect | ) |
const |
|
private |
◆ DrawCheckBox()
| void CCheckBoxHeader::DrawCheckBox |
( |
QPainter * |
painter, |
|
|
const QRect & |
rect, |
|
|
Qt::CheckState |
state, |
|
|
bool |
enabled |
|
) |
| const |
|
private |
◆ DrawText()
| void CCheckBoxHeader::DrawText |
( |
QPainter * |
painter, |
|
|
const QRect & |
rect, |
|
|
const QString & |
text, |
|
|
Qt::Alignment |
alignment |
|
) |
| const |
|
private |
◆ GetCheckState()
| Qt::CheckState CCheckBoxHeader::GetCheckState |
( |
int |
index | ) |
const |
◆ isCheckable()
| bool CCheckBoxHeader::isCheckable |
( |
int |
index | ) |
const |
◆ mousePressEvent()
| void CCheckBoxHeader::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ paintSection()
| void CCheckBoxHeader::paintSection |
( |
QPainter * |
painter, |
|
|
const QRect & |
rect, |
|
|
int |
logicalIndex |
|
) |
| const |
|
overrideprotected |
◆ SetCheckable()
| void CCheckBoxHeader::SetCheckable |
( |
int |
index, |
|
|
bool |
checkable, |
|
|
Qt::CheckState |
state = Qt::Unchecked |
|
) |
| |
◆ SetCheckState()
| void CCheckBoxHeader::SetCheckState |
( |
int |
index, |
|
|
Qt::CheckState |
state |
|
) |
| |
◆ m_CheckableSections
| QHash<int, Qt::CheckState> CCheckBoxHeader::m_CheckableSections |
|
private |
该类的文档由以下文件生成: