TpMessageBox 类
V0.2.1TpGUIWidgets
2025-11-04
介绍
消息提示框
继承关系
基础信息
| 头文件: | include <TpMessageBox.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | TpDialog |
| 派生类: |
Public 类型
enum TpMessageBox::MessageType
| 名称 | 值 | 描述 |
|---|---|---|
| Information | 0 | |
| Question | 1 | |
| Warning | 2 | |
| Error | 3 |
信号
| 信号名称 | 参数 | 描述 |
|---|---|---|
| onClose | int32_t | 消息框关闭信号 参数:int32_t: 用户点击的交互按钮索引,从0开始 |
Public 成员函数
| TpMessageBox(MessageType type=TpMessageBox::Information) | ||
|---|---|---|
| TpMessageBox(const TpString &text, MessageType type=TpMessageBox::Information) | ||
| ~TpMessageBox() | ||
| exec() override | 模态显示消息对话框 | |
| setText(const TpString &text) | 设置按钮文本 | |
| setMessageType(MessageType type) | 设置消息框类型;内部根据类型自动生成交互按钮 | |
| setButtonList(const TpVector< TpString > &buttonList) | 设置消息框按钮列表,最大最好不要超过四个 |
成员函数说明
TpMessageBox::TpMessageBox(MessageType type=TpMessageBox::Information)
暂无注释...
TpMessageBox::TpMessageBox(const TpString &text, MessageType type=TpMessageBox::Information)
暂无注释...
virtual TpMessageBox::~TpMessageBox()
暂无注释...
void TpMessageBox::exec() override
模态显示消息对话框...
模态显示消息对话框
返回值:返回点击ID索引
virtual void TpMessageBox::setText(const TpString &text)
设置按钮文本...
设置按钮文本
参数:text: 文本内容
void TpMessageBox::setMessageType(MessageType type)
设置消息框类型;内部根据类型自动生成交互按钮...
设置消息框类型;内部根据类型自动生成交互按钮
参数:type: 类型枚举
void TpMessageBox::setButtonList(const TpVector< TpString > &buttonList)
设置消息框按钮列表,最大最好不要超过四个...
设置消息框按钮列表,最大最好不要超过四个
参数:buttonList: 按钮文本列表
