Qt学习笔记 QMessageBox
2023-09-27 14:26:23 时间
Qt的几种MessageBox
1.Infomation类型
QMessageBox::information(this,tr("hello"),tr("title"));
2.Question类型
QMessageBox::StandardButton returnBtn; returnBtn = QMessageBox::question(this,tr("hello have problem?"),tr("error!"),QMessageBox::Yes|QMessageBox::No); if(returnBtn==QMessageBox::Yes) { QMessageBox::information(this,tr("Yes!"),tr("error")); }
3.Warning类型
QMessageBox::warning(this,tr("warning!"),tr("warning!"));
4.自定义类型
QMessageBox msg; msg.setText("customer!"); msg.setWindowTitle(tr("titleHaHa")); msg.setStandardButtons(QMessageBox::Ok|QMessageBox::Cancel); msg.exec();
相关文章
- Ubuntu下Qt(Retex)无法输入中文
- Qt中标准对话框实例,QObject::tr()的作用
- 【应用开发】在Linux下搭建嵌入式Qt交叉编译环境时的笔记(命令记录)
- 基于QT(C++)+SQLServer实现(WinForm)超市管理系统【100010143】
- 基于QT(C++)+CSV文件存储开发(WinForm)图书管理系统【100010008】
- centos7 安装qt
- Qt音视频开发11-通用监控布局控件(开源)
- Qt数据库应用6-数据图文混排
- Qt编写地图综合应用28-闪烁点图
- Qt开发经验小技巧161-165
- Qt开发经验小技巧81-90
- Qt JSON解析生成笔记(把JSON转成一个类对象)
- Qt之等待提示框(QPropertyAnimation)
- 软件设计开发笔记2:基于QT设计串口调试工具
- Qt学习笔记
- Qt 按钮事件不响应
- Qt 静态编译与使用(6.2 详解版)