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 -1 is 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.

QButtonGroup:按钮类的非可视化容器,默认可实现按钮的子类实例的单选。的更多相关文章

  1. bootstrap 图片类 和 按钮类 部分

    bootstrap框架,来自 Twitter,基于 html ,css ,js.简介灵活. 首先引入  bootstrap.js   bootstrap.css  及 jquery.js  这里不考虑 ...

  2. 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButton, AppBarButton, AppBarToggleButton

    [源码下载] 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButt ...

  3. 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButton, AppBarButton, AppBarToggleButton

    介绍背水一战 Windows 10 之 控件(按钮类) ButtonBase Button HyperlinkButton RepeatButton ToggleButton AppBarButton ...

  4. 八、pyqt5按钮类控件——QPushButton、QRadioButton、QCheckBox

    pyqt5中常用的按钮类控件有QPushButton.QRadioButton.QCheckBox.QToolButton等.这些按钮类的基类都是QAbstracButton类.所以这些类有部分方法是 ...

  5. WorldWind源码剖析系列:图层管理器按钮类LayerManagerButton和菜单条类MenuBar

    WorldWindow用户定制控件类中所包含的的可视化子控件主要有:图层管理器按钮类LayerManagerButton和菜单条类MenuBar.BmngLoader类中所包含的的可视化子控件主要有: ...

  6. 【Java并发工具类】Java并发容器

    前言 Java并发包有很大一部分都是关于并发容器的.Java在5.0版本之前线程安全的容器称之为同步容器.同步容器实现线程安全的方式:是将每个公有方法都使用synchronized修饰,保证每次只有一 ...

  7. Cocos2dx项目启程二 之 封装属于我的按钮类

    不知道为什么,很讨厌cocos2dx的 各菜单类,比如按钮:如果一张图片上就已经有按钮的几个状态了,我还是要创建多张资源图片, 最起码要指定这张图片上哪块区域是这个普通状态,哪块区域是那个选中状态.. ...

  8. MFC的PNG贴图按钮类(详细注释)

    MFC的PNG贴图按钮类(详细注释) (转载请注明出处) 作者:梦镜谷雨 萌新第二次写帖子,请多多包涵.末尾附上相应代码(PS公司繁体系统所以部分注释繁体请别介意). 因自带控件不美观,于是网上参考学 ...

  9. Java 中的静态嵌套类和非静态嵌套类

    Java 中的静态嵌套类和非静态嵌套类 术语:嵌套类分为两类:静态嵌套类和非静态嵌套类.声明 static 的嵌套类称为静态嵌套类,非静态嵌套类也称为内部类. class OuterClass { p ...

随机推荐

  1. JEECG中datagrid方法自定义查询条件

    自定义加添加查询条件的用法: CriteriaQuery cq = new CriteriaQuery(EquipmentEntity.class, dataGrid); //查询条件组装器 org. ...

  2. Jeecg 如何执行批量insert或者update操作,高效率

    方法:org.jeecgframework.core.common.dao.jdbc.SimpleJdbcTemplate.batchUpdate     原理: 基于springjdbc封装,批量提 ...

  3. mysql-cluster 环境安装&配置

    一.mysql-cluster 的介绍: 1.说心里话mysql-cluster这货性能上是不行的,之前一个同事测试了来的结果是8个主机组成的mysql-cluster性能 上搞不过一个单机的mysq ...

  4. 修改tmp的临时目录的地址

    https://nkcoder.github.io/2014/04/11/jetty-as-linux-service/ 我们在启动服务的时候添加-Djava.io.tmpdir=/data/jett ...

  5. NEXYS 3开发板练手--USB UART(三)

    接着上一篇,今天我们来建立一个能用于实际工程中的DEMO. 首先,为了使我们的发送机不像上一个DEMO一样无节制的循环发送,我们需要修改代码,增加使发送机停止发送的控制部分,修改后的代码如下: `ti ...

  6. lua连续随机数

    号外:惭愧,工作后几乎没有写博客了,其实是有时间的(每周单休),只是厌烦对着屏幕了,还有懒. 现在老板换人了,时间会多点,估计正常就每周双休了,决定还是每周写两篇(不一定是love2d), 写不出就翻 ...

  7. mysql show variables

    1. back_log 指定MySQL可能的连接数量.当MySQL主线程在很短的时间内得到非常多的连接请求,该参数就起作用,之后主线程花些时间(尽管很短)检查连接并且启动一个新线程. back_log ...

  8. JAVA经典算法40题面向过程

    JAVA经典算法40题 [程序1]   题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第四个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 1.程序分 ...

  9. python基础系列教程——Python的安装与测试:python的IDE工具PyDev和pycharm,anaconda

    ---恢复内容开始--- python基础系列教程——Python的安装与测试:python的IDE工具PyDev和pycharm,anaconda 从头开启python的开发环境搭建.安装比较简单, ...

  10. Unity3d中使用摄像机制作实时显示小地图

    Unity3d中使用摄像机制作实时显示小地图,以之前的tank为例.开始制作之前场景中物体如图. 开始制作,步骤1:新建一个camera及一个plane.对齐位置,将camera改名为camera_U ...