TpRadioButton 类
V0.1.1SingleGUIwidgets
2025-09-17
介绍
单选按钮
继承关系
基础信息
头文件: | include <TpRadioButton.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.1 |
继承类: | TpChildWidget |
派生类: |
信号
信号名称 | 参数 | 描述 |
---|---|---|
onClicked | bool |
Public 成员函数
TpRadioButton(TpChildWidget *parent=nullptr) | ||
---|---|---|
TpRadioButton(const TpString &text, TpChildWidget *parent=nullptr) | ||
~TpRadioButton() | ||
setAutoFit(bool enable=false) | 根据字体宽度和高度绘制,当设置时对齐将无效 | |
setSpacing(uint32_t space=1) | 设置按钮与文本间距值 | |
setRect(const int32_t &x, const int32_t &y, const int32_t &w, const int32_t &h) override | ||
setText(const TpString &text) | 设置按钮文本 | |
virtual TpFont * | font() | |
virtual TpString | pluginType() override | 组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式 |
Protected成员函数
onMousePressEvent(TpMouseEvent *event) override | ||
---|---|---|
onMouseRleaseEvent(TpMouseEvent *event) override | ||
onPaintEvent(TpPaintEvent *event) | 绘制事件,禁止在该函数调用 paint和update函数 |
成员函数说明
TpRadioButton::TpRadioButton(TpChildWidget *parent=nullptr)
暂无注释...
TpRadioButton::TpRadioButton(const TpString &text, TpChildWidget *parent=nullptr)
暂无注释...
virtual
TpRadioButton::~TpRadioButton()
暂无注释...
virtual
void TpRadioButton::setAutoFit(bool enable=false)
点击查看...
根据字体宽度和高度绘制,当设置时对齐将无效
参数:
enable: 是否自动调整
virtual
void TpRadioButton::setSpacing(uint32_t space=1)
点击查看...
设置按钮与文本间距值
参数:
space: 间距
virtual
void TpRadioButton::setRect(const int32_t &x, const int32_t &y, const int32_t &w, const int32_t &h) override
暂无注释...
virtual
void TpRadioButton::setText(const TpString &text)
点击查看...
设置按钮文本
参数:
text:
virtual
TpFont * TpRadioButton::font()
暂无注释...
virtual
TpString TpRadioButton::pluginType() override
点击查看...
组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式
返回值:
类名字符串
virtual
bool TpRadioButton::onMousePressEvent(TpMouseEvent *event) override
暂无注释...
virtual
bool TpRadioButton::onMouseRleaseEvent(TpMouseEvent *event) override
暂无注释...
virtual
bool TpRadioButton::onPaintEvent(TpPaintEvent *event)
点击查看...
绘制事件,禁止在该函数调用 paint和update函数
参数:
event: 绘制事件指针
返回值:
返回true继续执行子控件绘制