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. C 字符串常量和字符串变量定义和区别

    字符串常量 定义:在一个双引号""内的字符序列或者转义字符序列称为字符串常量 例如:"HA HA!"  "abc"  "\n\t& ...

  2. linux下man手册简介

    Linux提供了丰富的帮助手册,当你需要查看某个命令的参数时不必到处上网查找,只要man一下即可.Linux 的man手册共有以下几个章节: 1.Standard commands (标准命令)2.S ...

  3. PYNQ = Python + ZYNQ —— ZYNQ部分功能的Python化

    PYNQ优点:1.    Python用于ZYNQ开发,Python库和FPGA硬件库可以直接调用,极大加快开发进程.缩短开发周期.降低开发难度,更方便.快捷:2.    用PYNQ开发,当Pytho ...

  4. mogoose的bug之不能根据类型为number的字段查找数据

    Users.find({paw:6868}).exec() //返回的结果为空 Users.find({paw:"6868"}).exec() //返回的结果也为空 Users.f ...

  5. Oracle“不等于号”与Null的情况

    今天突然才发现,Oracle中的“不等于操作符”是忽略Null的. 比如,查询comm不等于的300的记录,我会理所当然地使用where comm != 300 预想会返回包含Null的不等于300的 ...

  6. 【NOI】9272 偶数个三

    题目 链接:bajdcc/ACM 描述 在所有的N位数中,有多少个数中有偶数个数字3?结果模12345.(1<=N<=10000) 样例输入 2 样例输出 73 方法一:穷举 评价:最简单 ...

  7. HDS(日立)AMS2000系列存储管理配置方法

    转自:老管网络日志 配置日立存储AMS2000系列时也要和IBM存储一样,首先在客户端或者管理机上安装一个客户端,通过这个客户端再去管理存储. 管理软件名称为Storage Navigator Mod ...

  8. java 多线程8 : synchronized锁机制 之 方法锁

    脏读 一个常见的概念.在多线程中,难免会出现在多个线程中对同一个对象的实例变量或者全局静态变量进行并发访问的情况,如果不做正确的同步处理,那么产生的后果就是"脏读",也就是取到的数 ...

  9. ehcache 缓存管理工具

    ehcache  ehcache.xml <ehcache>   <diskStore path="java.io.tmpdir" />   <def ...

  10. dubbox2.8.4例子教程二

    简介 上篇博客写了个dubbox生产者,也用HttpClient代码测试了rest服务,下面记录dubbox消费者工程  一.工程结构    一.Simple.java package bhz.ent ...