#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的更多相关文章

  1. QT添加二次确认功能,QMessageBox的使用

    对于一些重要的操作需要让用户再次确认一次,给出几个基本的实例 是和否 switch( QMessageBox::warning(NULL, "warning",QString::f ...

  2. Qt学习笔记 QMessageBox

    Qt的几种MessageBox 1.Infomation类型 QMessageBox::information(this,tr("hello"),tr("title&qu ...

  3. QMessageBox 使用方法

    在Qt中经常需要弹出窗口,QMessageBox可以实现此功能,一共有三种窗口,information, question, 和 warning,critical, about分别对应感叹号,问号和叉 ...

  4. qt QMessageBox QInputDialog

    最近用到了QMessgaeBox和QInputDialog,QMessageBox用于提示,警告等消息,QInputDialog给用户弹出输入对话框. 参考链接 http://chenboqiang. ...

  5. QMessageBox中按钮的汉化

    方法一:直接添加汉语按钮: QMessageBox mess(QMessageBox::Question, "删除提示", "确认删除所选组件?", NULL) ...

  6. QMessageBox类学习:

    先来看一下最熟悉的QMessageBox::information.我们在以前的代码中这样使用过:   QMessageBox::information(NULL, "Title" ...

  7. Qt之国际化(系统文本-QMessageBox按钮、QLineEdit右键菜单等)

    简介 使用Qt的时候,经常会遇到英文问题,例如:QMessageBox中的按钮.QLineEdit.QSpinBox.QScrollBar中的右键菜单等.通常情况下,我们软件都不会是纯英文的,那么如何 ...

  8. 【Qt】Qt之自定义界面(QMessageBox)【转】

    简述 通过前几节的自定义窗体的学习,我们可以很容易的写出一套属于自己风格的界面框架,通用于各种窗体,比如:QWidget.QDialog.QMainWindow. 大多数窗体的实现都是采用控件堆积来完 ...

  9. 【Qt】Qt国际化(系统文本-QMessageBox按钮、QLineEdit右键菜单等)【转】

    简介 使用Qt的时候,经常会遇到英文问题,例如:QMessageBox中的按钮.QLineEdit.QSpinBox.QScrollBar中的右键菜单等.通常情况下,我们软件都不会是纯英文的,那么如何 ...

随机推荐

  1. AIM Tech Round 3 (Div. 2)

    #include <iostream> using namespace std; ]; int main() { int n, b, d; cin >> n >> ...

  2. 【BZOJ】1106: [POI2007]立方体大作战tet

    题意 给定一个长度为\(2n(1 \le n \le 500000)\)的序列,\(1\)~\(n\)各出现两次,可以交换相邻两项,两个同样的数放在一起会对消,求把所有数对消的最小交换次数. 分析 如 ...

  3. InterBase数据库迁移到MySQL(数据导入)

    在这个脚本中我使用的是Python的ORM框架SQLAlchemy来连接远程的MySQL数据库的,在写这个脚本的时候为了方便参数的输入,我就给之前和这个脚本添加了一个新的功能,就是在调用这个脚本的时候 ...

  4. Selenium_Selenium WebDriver 中鼠标和键盘事件分析及扩展

    在使用 Selenium WebDriver 做自动化测试的时候,会经常模拟鼠标和键盘的一些行为.比如使用鼠标单击.双击.右击.拖拽等动作:或者键盘输入.快捷键使用.组合键使用等模拟键盘的操作.在 W ...

  5. 查看linux中某个端口(port)是否被占用(netstat,lsof)

    查看linux中某个端口(port)是否被占用(netstat,lsof) netstat命令可以显示网络连接,路由表,接口状态,伪装连接,网络链路信息和组播成员组等信息.命令格式:netstat [ ...

  6. How parse REST service JSON response

    1. get JSON responses and go to : http://json2csharp.com/ 2. write data contracts using C# All class ...

  7. ado.net 完整修改删除,攻击防攻击

    完整修改和删除:当你输入了要删除的用户名,先提示有没有此条数据 先查 后删/后改------------ using System; using System.Collections.Generic; ...

  8. 拿到添加对象的id号方法

    以前Hibernate添加对象,想拿到id号的时候都是根据id排序拿到第一条 ,才知道 这样也可以 /**         * @Description: 添加一个角色信息        * @ret ...

  9. php中提示Undefined index的解决方法

    我们经常接收表单POST过来的数据时报Undefined index错误,如下: $act=$_POST['action']; 用以上代码总是提示 Notice: Undefined index: a ...

  10. 段落的展开收起(substring的应用)

    <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...