Qt入门-单选框和复选框
来源:互联网 发布:软件分发平台 编辑:程序博客网 时间:2024/09/21 06:20
在Qt GUI中,单选框类是QRadioButton,复选框类是QCheckBox。它们都是QAbstractButton的派生类。
(1)单选框
示例:
//设置为选择状态radioButton->setChecked(true);//返回选择状态bool radio_sel = radioButton->isChecked();
(2)复选框
复选框不同于单选框,它有三种状态:checked、unchecked和PartiallyChecked。
Qt::Unchecked0The item is unchecked.Qt::PartiallyChecked1The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked.Qt::Checked2The item is checked.
常用方法和属性如下:
//返回选择的状态Qt::CheckStatecheckState () const//是否处于PartiallyChecked状态boolisTristate () const//设置选择的状态,checked或uncheckedvoidsetCheckState ( Qt::CheckState state )//设置为PartiallyChecked状态voidsetTristate ( bool y = true )
- Qt入门-单选框和复选框
- 【QT】:QT中的单选框和复选框的使用
- 单选框和复选框
- 复选框和单选框
- 复选框和单选框
- 单选框和复选框
- 单选框和复选框
- Qt treewidget 复选框
- QT复选框使用
- 单选框和复选框组
- Qt基础 07_单选框、复选框及实例
- 弹框和单选框,复选框
- HTML复选框和单选框 radio checkbox
- 初学单选框RadioButton和复选框CheckBox
- win32 019使用单选框和复选框
- 单选框和复选框的属性使用
- Android—复选框和单选框使用
- java中复选框和单选框按钮
- KISSY
- 通用数据结构
- webService常用名词
- memcache在大型网站的应用策略【转】
- Log4j配置详解
- Qt入门-单选框和复选框
- 中文分词
- Android的编译、打包流程以及手动打包编译的方法
- 寄存器和内存的关系
- 支持响应式布局的超棒颜色选择器 - colorjoe
- SQL server 批量修改
- javascript正则表达式之小结(二)
- Top journal of computer science (Media & Software Technology)
- c++ 源码 +工具+库