TpRadioButtonGroup 类
V0.2.1TpGUIWidgets
2025-11-14
介绍
单选按钮组;组内单选按钮只能被选中一个
基础信息
| 头文件: | include <TpRadioButtonGroup.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
信号
| 信号名称 | 参数 | 描述 |
|---|---|---|
| buttonClicked | TpRadioButton * | 按钮点击事件,鼠标释放触发 参数:TpRadioButton: 按钮指针 |
Public 成员函数
| TpRadioButtonGroup() | ||
|---|---|---|
| ~TpRadioButtonGroup() | ||
| addButton(TpRadioButton *radioBtn, const int32_t &id=-1) | 添加一个单选按钮 | |
| TpList< TpRadioButton * > TpRadioButtonGroup::buttons | buttons() | 获取组内所有按钮信息 |
| TpRadioButton * TpRadioButtonGroup::button | button(const int32_t &id) | 指定按钮ID获取按钮指针 |
| id(TpRadioButton *button) const | 指定按钮指针获取按钮ID | |
| TpRadioButton * TpRadioButtonGroup::checkedButton | checkedButton() const | 获取当前选中的单选按钮 |
| checkedId() const | 获取当前选中的按钮ID |
成员函数说明
TpRadioButtonGroup::TpRadioButtonGroup()
暂无注释...
virtual TpRadioButtonGroup::~TpRadioButtonGroup()
暂无注释...
int32_t TpRadioButtonGroup::addButton(TpRadioButton *radioBtn, const int32_t &id=-1)
添加一个单选按钮...
添加一个单选按钮
参数:radioBtn: 按钮指针
参数:id: 按钮ID,不给入则自动分配;给入ID若重复则会重新分配
返回值:按钮ID
TpList< TpRadioButton * > TpRadioButtonGroup::buttons()
获取组内所有按钮信息...
获取组内所有按钮信息
返回值:按钮列表
TpRadioButton * TpRadioButtonGroup::button(const int32_t &id)
指定按钮ID获取按钮指针...
指定按钮ID获取按钮指针
参数:id: 按钮ID
返回值:按钮指针;ID不存在则返回空指针
int32_t TpRadioButtonGroup::id(TpRadioButton *button) const
指定按钮指针获取按钮ID...
指定按钮指针获取按钮ID
参数:button: 按钮指针
返回值:按钮ID
TpRadioButton * TpRadioButtonGroup::checkedButton() const
获取当前选中的单选按钮...
获取当前选中的单选按钮
返回值:按钮指针,若组内没有按钮,则返回空指针
int32_t TpRadioButtonGroup::checkedId() const
获取当前选中的按钮ID...
获取当前选中的按钮ID
返回值:按钮ID;若组内没有按钮,会返回-1
