1 QCheckBox
1.1 QCheckBox简介
QCheckBox 继承自 QAbstractButton,它提供了一个带文本标签的复选框。
QCheckBox(复选框)和 QRadioButton(单选框)都是选项按钮。这是因为它们都可以在开(选中)或者关(未选中)之间切换。区别是对用户选择的限制:单选框定义了“多选一”的选择,而复选框提供的是“多选多”的选择。
复选框不同于单选框,它有三种状态:checked、unchecked 和 PartiallyChecked。
- Qt::Unchecked 0 The item is unchecked.
- Qt::PartiallyChecked 1 The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked.
- Qt::Checked 2 The item is checked.
常用方法和属性:
Qt::CheckState checkState () const
bool isTristate () const
void setCheckState ( Qt::CheckState state )
void setTristate ( bool y = true ), triple
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)