QButtonGroup的简单应用

QButtonGroup的简单应用

所有代码都是在qt3.3.8+fedora8下运行的。

QButtonGroup用于统一管理一组QButton按钮。理论上所有继承自QButton的按钮类都可以使用。这里以QPushButton和QRadioButton为例演示。
按钮分组的作用主要用在项目选择上,可以单选,也可以多选,根据属性设置而定。

头文件: <qbuttongroup.h>

主要属性和函数:
int id:
按钮的标签,可以用这个标签来获得或操作组里的各个按钮。

bool exclusive:
This property holds whether the button group is exclusive. 
If this property is TRUE, then the buttons in the group are toggled, and to untoggle a button you must click on another button in the group. The default value is FALSE. 
Set this property's value with setExclusive() and get this property's value with isExclusive().
独占属性
它标示了这个按钮组是否只能有一个按钮处于激活状态。
如果这个属性是TRUE,那么组里所有按钮都被toggled(不太会翻译这个词),要想取消一个按钮,必须点击另一个按钮。默认是

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值