提示框 tpMessageBox
2025-07-17
介绍
tpMessageBox 类 tpMessageBox 为消息提示框,一般用于模态提示用户信息,包括警告、消息、错误、询问四大类。
使用示例
tpButton *button1 = new tpButton("消息框", vScreen);
button1->setRect(20, 20, 100, 50);
connect(button1, onClicked, [=](bool)
{ tpMessageBox::information("消息弹出框"); });
tpButton *button2 = new tpButton("警告框", vScreen);
button2->setRect(20, 80, 100, 50);
connect(button2, onClicked, [=](bool)
{ tpMessageBox::warning("警告弹出框"); });
tpButton *button3 = new tpButton("询问框", vScreen);
button3->setRect(20, 140, 100, 50);
connect(button3, onClicked, [=](bool)
{ tpMessageBox::question("询问弹出框"); });
tpButton *button4 = new tpButton("错误框", vScreen);
button4->setRect(20, 200, 100, 50);
connect(button4, onClicked, [=](bool)
{ tpMessageBox::error("错误弹出框"); });
效果演示
- 信息(Information)

- 询问(Question)

- 警告(Warning)

- 错误(Error)
