QMessageBox

#include "dialog.h"
#include "ui_dialog.h"
#include<QMessageBox> Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
} Dialog::~Dialog()
{
delete ui;
} void Dialog::on_pushButton_clicked()
{
//info
QMessageBox::information(this,"title here","Text Here");
} void Dialog::on_pushButton_2_clicked()
{
//question
QMessageBox::StandardButton reply;
reply = QMessageBox::information(this,"title here","Do you like cats?",QMessageBox::Yes|QMessageBox::No); if(reply == QMessageBox::Yes)
{
QMessageBox::information(this,"title here","You LOVE cats");
}
} void Dialog::on_pushButton_3_clicked()
{
QMessageBox::warning(this,"title here","Waring");
} void Dialog::on_pushButton_4_clicked()
{
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this,"My Title","My Test here", QMessageBox::YesToAll|QMessageBox::Yes|QMessageBox::No|QMessageBox::NoToAll); if(reply == QMessageBox::Yes)
{
QMessageBox::information(this,"title here","YES");
}
}
QMessageBox的更多相关文章
- QT添加二次确认功能,QMessageBox的使用
对于一些重要的操作需要让用户再次确认一次,给出几个基本的实例 是和否 switch( QMessageBox::warning(NULL, "warning",QString::f ...
- Qt学习笔记 QMessageBox
Qt的几种MessageBox 1.Infomation类型 QMessageBox::information(this,tr("hello"),tr("title&qu ...
- QMessageBox 使用方法
在Qt中经常需要弹出窗口,QMessageBox可以实现此功能,一共有三种窗口,information, question, 和 warning,critical, about分别对应感叹号,问号和叉 ...
- qt QMessageBox QInputDialog
最近用到了QMessgaeBox和QInputDialog,QMessageBox用于提示,警告等消息,QInputDialog给用户弹出输入对话框. 参考链接 http://chenboqiang. ...
- QMessageBox中按钮的汉化
方法一:直接添加汉语按钮: QMessageBox mess(QMessageBox::Question, "删除提示", "确认删除所选组件?", NULL) ...
- QMessageBox类学习:
先来看一下最熟悉的QMessageBox::information.我们在以前的代码中这样使用过: QMessageBox::information(NULL, "Title" ...
- Qt之国际化(系统文本-QMessageBox按钮、QLineEdit右键菜单等)
简介 使用Qt的时候,经常会遇到英文问题,例如:QMessageBox中的按钮.QLineEdit.QSpinBox.QScrollBar中的右键菜单等.通常情况下,我们软件都不会是纯英文的,那么如何 ...
- 【Qt】Qt之自定义界面(QMessageBox)【转】
简述 通过前几节的自定义窗体的学习,我们可以很容易的写出一套属于自己风格的界面框架,通用于各种窗体,比如:QWidget.QDialog.QMainWindow. 大多数窗体的实现都是采用控件堆积来完 ...
- 【Qt】Qt国际化(系统文本-QMessageBox按钮、QLineEdit右键菜单等)【转】
简介 使用Qt的时候,经常会遇到英文问题,例如:QMessageBox中的按钮.QLineEdit.QSpinBox.QScrollBar中的右键菜单等.通常情况下,我们软件都不会是纯英文的,那么如何 ...
随机推荐
- 每天一个linux命令---导出到文件
导出Linux下的部分日志到文件,使用‘>’符号 例如: [calendar@test190 logs]$ monitor.log|grep getCalendarView > share ...
- ajax请求 json格式和数组格式总结
php echo json_encode($data); $.ajax({ url:APP+"?a=total&c=collection", //请求的页面 type:&q ...
- Java NIO之通道Channel
channel与流的区别: 流基于字节,且读写为单向的. 通道基于快Buffer,可以异步读写.除了FileChannel之外都是双向的. channel的主要实现: FileChannel Data ...
- 未能加载文件或程序集"Microsoft.Web.Infrastructure 的解决方案
转载请注明来源: http://www.cnblogs.com/zaiyuzhong/p/Unload-Infrastructure-Solution.html 部署MVC5 项目发布到文件系统 I ...
- 设置 tableview 的背景 颜色 和清空
表示图中Cell默认是不透明的,那么在设置表示图的背景颜色和图片时通常是看不到的 1.给tableView设置背景view UIImageView *backImageView=[[UIImageVi ...
- 没人告诉你关于z-index的一些事
关于z-index的问题是很多程序员都不知道它是如何起作用的.说起来不难,但是大部分人并没有花时间去看规范,这往往会照成严重的后果. 你不信?那就一起来看看下面的问题. 问题 在下面的HTML我们写了 ...
- SRM 595 DIV2 1000
数位DP的感觉,但是跟模版不是一个套路的,看的题解,代码好理解,但是确实难想. #include <cstdio> #include <cstring> #include &l ...
- 编码Q&A
Q:什么是编码? A:由于计算机中所有数据都是以二进制存在,那么为了存储数字,字母,各种符号和文字,计算机必须用一套映射系统来对应.比如我在某台计算机上规定,用00010001这个二进制数表示字母a, ...
- docker 练习
echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker sudo docker run -i -t centos ...
- PHP 进行数据庫对比工具
<?php /** * author jackluo * net.webjoy@gmail.com */ class IMysqlDiff { private $master,$slave; p ...