#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. JStorm之Nimbus简介

    本文导读: ——JStorm之Nimbus简介 .简介 .系统框架与原理 .实现逻辑和代码剖析 )Nimbus启动 )Topology提交 )任务调度 )任务监控 .结束语 .参考文献 附:JStor ...

  2. Scheduled Projects

    Plans as at 10/03/15 ASB                                                             --------> Li ...

  3. [Leetcode|SQL] Combine Two Tables

    Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId ...

  4. 优化特性(Attribute)性能

    通过这篇文章,不仅可以了解到Attribute的工作原理,还可以了解到GetcustomeAttribute是的内部执行流程.最后,你会看到,使用缓存机制可以极大的优化反射Attribute的性能. ...

  5. 【HDU】4035 Maze

    http://acm.hdu.edu.cn/showproblem.php?pid=4035 题意:给一棵n个节点的树,每个节点有值k[i]和e[i],分别表示k[i]概率走向1号节点,e[i]概率获 ...

  6. Android -- 服务组件的使用(1)

    1. 效果图

  7. 热烈庆祝华清远见成功自主研发Farsight TV 智能机顶盒

    近日,华清远见研发中心再传喜讯:Farsight TV 智能机顶盒研发成功并投入教学!这是华清远见研发中心继开源平板电脑.智能医疗终端.智能家居终端后独立成功研发的又一智能硬件!至此,开创了华清远见自 ...

  8. flex lineChart 显示所有的数据节点

    .If you're using <mx:LineSeries>, then set the following property:itemRenderer="mx.charts ...

  9. JS实现设为首页与加入收藏

    <script type="text/javascript"> // 设置为主页 function SetHome(obj, vrl) { try { obj.styl ...

  10. 制作、解析带logo的二维码

    用DecoderQRCode来解析带logo的二维码,发现报错,解析不了,于是便又查资料,找到了更强大的制作二维码 工具:GooleZXing 首先下GooleZXing的jar包. -------- ...