玉兔远程控制 0.1.0-bate14
载入中...
搜索中...
未找到
CCheckBoxHeader类 参考

包含复选框的表头 更多...

#include <CheckBoxHeader.h>

类 CCheckBoxHeader 继承关系图:
CCheckBoxHeader 的协作图:

信号

void sigCheckStateChanged (int index, Qt::CheckState state)

Public 成员函数

 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

Protected 成员函数

void paintSection (QPainter *painter, const QRect &rect, int logicalIndex) const override
void mousePressEvent (QMouseEvent *event) override

Private 成员函数

QRect CheckboxRect (const QRect &sectionRect) 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

Private 属性

QHash< int, Qt::CheckState > m_CheckableSections

详细描述

包含复选框的表头

  • 如果模型是 QStandardItemModel ,则会根据 QStandardItem::isCheckable() 来判断是否显示复选框
  • 如果模型不是 QStandardItemModel ,则使用 SetCheckState() 来决定是否显示复选框

在文件 CheckBoxHeader.h 第 18 行定义.

成员函数说明

◆ CheckboxRect()

QRect CCheckBoxHeader::CheckboxRect ( const QRect & sectionRect) const
private

在文件 CheckBoxHeader.cpp 第 103 行定义.

◆ DrawCheckBox()

void CCheckBoxHeader::DrawCheckBox ( QPainter * painter,
const QRect & rect,
Qt::CheckState state,
bool enabled ) const
private

在文件 CheckBoxHeader.cpp 第 160 行定义.

◆ DrawText()

void CCheckBoxHeader::DrawText ( QPainter * painter,
const QRect & rect,
const QString & text,
Qt::Alignment alignment ) const
private

在文件 CheckBoxHeader.cpp 第 187 行定义.

◆ GetCheckState()

Qt::CheckState CCheckBoxHeader::GetCheckState ( int index) const

在文件 CheckBoxHeader.cpp 第 45 行定义.

◆ isCheckable()

bool CCheckBoxHeader::isCheckable ( int index) const

在文件 CheckBoxHeader.cpp 第 88 行定义.

◆ mousePressEvent()

void CCheckBoxHeader::mousePressEvent ( QMouseEvent * event)
overrideprotected

在文件 CheckBoxHeader.cpp 第 207 行定义.

◆ paintSection()

void CCheckBoxHeader::paintSection ( QPainter * painter,
const QRect & rect,
int logicalIndex ) const
overrideprotected

在文件 CheckBoxHeader.cpp 第 115 行定义.

◆ SetCheckable()

void CCheckBoxHeader::SetCheckable ( int index,
bool checkable,
Qt::CheckState state = Qt::Unchecked )

设置是否显示复选框

注解
在调用前必须先设置了模型

在文件 CheckBoxHeader.cpp 第 65 行定义.

◆ SetCheckState()

void CCheckBoxHeader::SetCheckState ( int index,
Qt::CheckState state )

设置表头复选框状态

注解
在调用前必须先设置了模型

在文件 CheckBoxHeader.cpp 第 20 行定义.

类成员变量说明

◆ m_CheckableSections

QHash<int, Qt::CheckState> CCheckBoxHeader::m_CheckableSections
private

在文件 CheckBoxHeader.h 第 51 行定义.


该类的文档由以下文件生成: