qt4 messagebox
来源:互联网 发布:贵阳大数据学校招生 编辑:程序博客网 时间:2024/06/06 01:53
refer to qt QMessageBox Class Reference
头文件是:
QString QObject::tr ( const char * sourceText, const char * disambiguation = 0, int n = -1 ) [static]
Returns a translated version of sourceText, optionally based on a disambiguation string and value of n for strings containing plurals; otherwise returns sourceText itself if no appropriate translated string is available.
头文件是:
#include <QMessageBox>1.
QMessageBox msgBox; msgBox.setText("The document has been modified."); msgBox.exec();2.
QMessageBox msgBox; msgBox.setText("The document has been modified."); msgBox.setInformativeText("Do you want to save your changes?"); msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Save); int ret = msgBox.exec();
switch (ret) { case QMessageBox::Save: // Save was clicked break; case QMessageBox::Discard: // Don't Save was clicked break; case QMessageBox::Cancel: // Cancel was clicked break; default: // should never be reached break; }3.
int ret = QMessageBox::warning(this, tr("My Application"),tr("The document has been modified.\n" "Do you want to save your changes?"), QMessageBox::Save | QMessageBox::Discard| QMessageBox::Cancel, QMessageBox::Save); QMessageBox::warning(this,"title","hello every body"); QMessageBox::warning(this,"title",tr("hello every body")); QString name="song"; int i=666; QMessageBox::warning(this,"title",tr("hello %1 ,%2").arg(name).arg(i));//参数只需指定%1 %2,不必%s %dtr是QObject的一个静态成员函数,返回QString
QString QObject::tr ( const char * sourceText, const char * disambiguation = 0, int n = -1 ) [static]
Returns a translated version of sourceText, optionally based on a disambiguation string and value of n for strings containing plurals; otherwise returns sourceText itself if no appropriate translated string is available.
- qt4 messagebox
- MessageBox
- MessageBox()
- MessageBox
- MessageBox
- messageBox
- MessageBox
- MessageBox
- MessageBox()
- MessageBox
- MessageBox
- messagebox
- MessageBox
- MessageBox
- MessageBox
- MessageBox
- MessageBox();
- MessageBox
- qt4程序执行流程
- ubuntu mysql c api的使用开发实例程序。
- 20个公司绝对不会告诉你的秘密
- 献10款chart图表JS插件
- 用递归算法判断数组a[N]是否为一个递增数组
- qt4 messagebox
- VC++里Profile的使用方法
- 用route命令添加永久路由
- 怎样修改和或许editbox里的文本
- Java Annotation 常用的注解
- Linux设备模型组件---总线
- 让 Chrome 浏览器随时推送正在浏览的相关信息
- Oracle学习笔记(一)--------win7下安装Oracle 10g
- shell scripts