一些常用的消息对话框的操作
1 //点击新建按钮,弹出一个对话框
2 connect(ui->actionNew,&QAction::triggered,[=](){
3 //消息对话框
4 //关于对话框
5 // QMessageBox::about(this,"关于","这是一首情歌");
6
7 //错误对话框
8 // QMessageBox::critical(this,"错误","有错误");
9
10 //信息对话框
11 // QMessageBox::information(this,"信息","信息对话框");
12
13 //提问对话框
14 // QMessageBox::question(this,"提问","是否需要此步骤", QMessageBox::Save | QMessageBox::Cancel);
15
16 //警示对话框
17 QMessageBox::warning(this,"警示","请不要非法偷渡");
来源:https://www.cnblogs.com/liuxjie/p/12182744.html