QCheckBox

 

#include <QCheckBox>

 

Properties

Public Functions

  QCheckBox(QWidget *parent = nullptr)
  QCheckBox(const QString &text, QWidget *parent = nullptr)
virtual ~QCheckBox()
Qt::CheckState checkState() const
bool isTristate() const
void setCheckState(Qt::CheckState state)
void setTristate(bool y = true)

Reimplemented Public Functions

virtual QSize minimumSizeHint() const override
virtual QSize sizeHint() const override

Signals

void stateChanged(int state)

Protected Functions

void initStyleOption(QStyleOptionButton *option) const

Reimplemented Protected Functions

virtual void checkStateSet() override
virtual bool event(QEvent *e) override
virtual bool hitButton(const QPoint &pos) const override
virtual void mouseMoveEvent(QMouseEvent *e) override
virtual void nextCheckState() override
virtual void paintEvent(QPaintEvent *) override

Additional Inherited Members

  • 5 public slots inherited from QAbstractButton
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 5 static public members inherited from QWidget
  • 10 static public members inherited from QObject
  • 1 protected slot inherited from QWidget
  • 2 protected variables inherited from QObject
  • 1 protected type inherited from QPaintDevice

Detailed Description

The QCheckBox widget provides a checkbox with a text label.

 

 

使用案例

 

绑定槽函数:

connect(this->dCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotDCheckBoxChangeState(int)));

 

复制代码
void slotDCheckBoxChangeState(int stateParam)
{
    
    if (stateParam==2)
    {
        //选中
    }
    
    if(stateParam ==0)
    {
        //取消选中
    }
}
复制代码

 

 

 

####################

posted @   西北逍遥  阅读(170)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
历史上的今天:
2021-06-16 C# opencv Form显示图片
2020-06-16 IfcProjectionElementTypeEnum
2020-06-16 IfcPhysicalOrVirtualEnum
2019-06-16 ubuntu 安装百度云客户端
2019-06-16 OSG Qt Widget加载三维模型
2018-06-16 解析IFC数据并存储到关系型数据库
2017-06-16 使用R语言绘制图表
点击右上角即可分享
微信分享提示