QButtonGroup:按钮类的非可视化容器,默认可实现按钮的子类实例的单选。
2015-09-12 13:48
323 查看
QButtonGroup
The QButtonGroup class provides a container to organize groups of button widgets.
QButtonGroup provides an abstract container into which button widgets can be placed. It does not provide a visual representation of this container (see QGroupBox for a container widget), but instead manages the states of each of the buttons in the group.
An exclusive button group switches off all checkable (toggle) buttons except the one that has been clicked. By default, a button group is exclusive. The buttons in a button group are usually checkable QPushButtons,QCheckBoxes (normally for non-exclusive button groups), or QRadioButtons. If you create an exclusive button group, you should ensure that one of the buttons in the group is initially checked; otherwise, the group will initially be in a state where no buttons are checked.
A button can be added to the group with addButton() and removed with removeButton(). If the group is exclusive, the currently checked button is available with checkedButton(). If a button is clicked, thebuttonClicked() signal is emitted; for a checkable button in an exclusive group this means that the button has been checked. The list of buttons in the group is returned by buttons().
In addition, QButtonGroup can map between integers and buttons. You can assign an integer id to a button with setId(), and retrieve it with id(). The id of the currently checked button is available with checkedId(), and there is an overloaded signal buttonClicked() which emits the id of the button. The id
The QButtonGroup class provides a container to organize groups of button widgets.
QButtonGroup provides an abstract container into which button widgets can be placed. It does not provide a visual representation of this container (see QGroupBox for a container widget), but instead manages the states of each of the buttons in the group.
An exclusive button group switches off all checkable (toggle) buttons except the one that has been clicked. By default, a button group is exclusive. The buttons in a button group are usually checkable QPushButtons,QCheckBoxes (normally for non-exclusive button groups), or QRadioButtons. If you create an exclusive button group, you should ensure that one of the buttons in the group is initially checked; otherwise, the group will initially be in a state where no buttons are checked.
A button can be added to the group with addButton() and removed with removeButton(). If the group is exclusive, the currently checked button is available with checkedButton(). If a button is clicked, thebuttonClicked() signal is emitted; for a checkable button in an exclusive group this means that the button has been checked. The list of buttons in the group is returned by buttons().
In addition, QButtonGroup can map between integers and buttons. You can assign an integer id to a button with setId(), and retrieve it with id(). The id of the currently checked button is available with checkedId(), and there is an overloaded signal buttonClicked() which emits the id of the button. The id
-1is reserved byQButtonGroup to mean "no such button". The purpose of the mapping mechanism is to simplify the representation of enum values in a user interface.
相关文章推荐
- One day trip to Jakarta Indonesia
- mac上安装配置maven
- Web设计之网页布局CSS技巧
- Tian Ji -- The Horse Racing (好题 逻辑题)
- php环境安装
- Delphi 学习笔记(2015.09.12)
- 减小iOS app release发布体积
- Delphi 学习笔记(2015.09.12)
- Product of Array Except Self
- 高性能JavaScript--加载和执行(简要学习笔记一)
- java小程序:输入五个整数顺序输出,再输入一个顺序输出
- CENTOS 6.x/7.x yum安装配置Nginx(最新版)
- java__线程通信02
- 判断两圆的位置关系
- Spark第一个研究笔记1一片 - Spark一个简短的引论
- asp.net缓存使用介绍
- Remove Duplicates from Sorted Array
- Spring 向页面传值以及接受页面传过来的参数的方式
- php strcasecmp()与strncasecmp()函数
- GB2312和UTF-8