#include <QCheckBox>
Properties
- tristate : bool
- 11 properties inherited from QAbstractButton
- 59 properties inherited from QWidget
- 1 property inherited from QObject
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 |
- 21 public functions inherited from QAbstractButton
- 214 public functions inherited from QWidget
- 34 public functions inherited from QObject
- 14 public functions inherited from QPaintDevice
Signals
void | stateChanged(int state) |
- 4 signals inherited from QAbstractButton
- 3 signals inherited from QWidget
- 2 signals inherited from QObject
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 |
- 14 protected functions inherited from QAbstractButton
- 35 protected functions inherited from QWidget
- 9 protected functions inherited from QObject
- 1 protected function inherited from QPaintDevice
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) { //取消选中 } }
####################