QMessageBox 中的 OK 按钮改为中文“确定”
| Constant | Value | Description |
| QMessageBox::InvalidRole | -1 | The button is invalid. |
| QMessageBox::AcceptRole | 0 | Clicking the button causes the dialog to be accepted (e.g. OK). |
| QMessageBox::RejectRole | 1 | Clicking the button causes the dialog to be rejected (e.g. Cancel). |
| QMessageBox::DestructiveRole | 2 | Clicking the button causes a destructive change (e.g. for Discarding Changes) and closes the dialog. |
| QMessageBox::ActionRole | 3 | Clicking the button causes changes to the elements within the dialog. |
| QMessageBox::HelpRole | 4 | The button can be clicked to request help. |
| QMessageBox::YesRole | 5 | The button is a "Yes"-like button. |
| QMessageBox::NoRole | 6 | The button is a "No"-like button. |
| QMessageBox::ApplyRole | 8 | The button applies current changes. |
| QMessageBox::ResetRole | 7 | The button resets the dialog's fields to default values. |
因此,用户可以使用 addButton() 和 removeButton() 方法,结合角色属性,来自定义 QMessageBox 的Button。
WrrMsg = new QMessageBox(QMessageBox::NoIcon, title, msg, QMessageBox::Ok, 0);
if(NULL!=WrrMsg->button(QMessageBox::Ok))
{
WrrMsg->button(QMessageBox::Ok)->setText("确 定");
}
其中,title为QString类型的窗口标题,msg为QString类型的消息内容,QMessageBox()具体信息请参见Qt的相关帮助文档。
QMessageBox 中的 OK 按钮改为中文“确定”的更多相关文章
- DevExpress GridView 自定义搜索按钮改为中文内容
首先将 GridControl 控件的搜索功能显示出来. http://www.cnblogs.com/DeepLearing/p/3887601.html 显示效果如下: 可以通过 GridLoca ...
- 如何将vs2015中的英文注释改为中文
找一个中文版的vs 将 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework 文件夹 ...
- java将url里面的中文改成ASCII字符集 和 SCII字符集 改成 中文
package com.example.demo; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; / ...
- QMessageBox 弹出框上的按钮设置为中文
Qt 默认的弹出框上的按钮式英文,虽然也知道是什么意思,但终究不如中文看着顺眼. QMessageBox box(QMessageBox::Warning,"标题","弹 ...
- QMessageBox中按钮的汉化
方法一:直接添加汉语按钮: QMessageBox mess(QMessageBox::Question, "删除提示", "确认删除所选组件?", NULL) ...
- ngui中 代码调用按钮事件(后来改成了按钮绑定键盘..)
ngui中 代码调用按钮事件 好烦人啊这个问题, 我弄完发上来 这个问题解决了一半 发现可以用 按钮绑定来解决这个问题,并且更安全方便快速 直接在按钮上添加一个 key binding 指定按键 搞定 ...
- 修改DevExpress中英文提示,将英文改为中文
1 : 修改DX 提示框中的英文字符 /// <summary> /// 重写DX弹出框 英文变为中文 /// </summary> public class CHS : De ...
- JSP中pageEncoding和charset区别,中文乱码解决方案(转载)
转载自:JSP中pageEncoding和charset区别,中文乱码解决方案 JSP指令标签中<%@ page contentType="text/html;charset=GB23 ...
- [转载](iPhone开发)Bundle Display Name 改为中文。ap
原文地址:(iPhone开发)Bundle Display Name 改为中文.app显示为中文作者:小新 要先在info的Localizations加入Chinese(zh-Hant) 再進到inf ...
随机推荐
- QDialog 模态对话框与事件循环(exec其实就是调用了show和eventLoop.exec)
起源 qtcn中文论坛中有网友问到: 假设程序正常运行时,只有一个简单的窗体A,此时只有一个GUI主线程,在这个主线程中有一个事件循环处理窗体上的事件.当此程序运行到某阶段时,弹出一个模态窗体B(书上 ...
- ubuntu scp
一.将本机文件复制到远程服务器上 scp -r /Users/Dreamover/Desktop/jsnone dreamover@localserver:/var/www/project/ /Use ...
- Temporary failure in name resolution
公司搬家,在一台测试机上执行git clone,出现错误 ssh: Could not resolve hostname **: Temporary failure in name resolutio ...
- Mac系统升级到10.9(mavericks)时安装php扩展问题解决(转)
问题一: 执行执行 phpize 报错: grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include ...
- Activity小结
Log日志类的五种级别 1.由高到低分别是:v.i.d.w.e 2.生命周期有七种状态: onCreate:创建 onStart:启动 onResume:显示(可以与用户交互) onPause:暂停 ...
- delphi 简单的删除字符串尾部数字的代码
delphi 简单的删除字符串尾部数字的代码 方式一: function FilterShowName(const sName: String): String; var I: Integer; b ...
- [RxJS] Updating Data with Scan
You often need to update the data flowing through the stream with custom logic based on what you nee ...
- World Wind Java开发之十五——载入三维模型
之前的一篇博客是关于载入粗三维模型的,见http://blog.csdn.net/giser_whu/article/details/43452703,这个地方还存在着不能载入纹理的问题,一直没呢解决 ...
- linux的chattr和lsattr命令
chattr是用来改变文件.目录属性.chattr命令的作用很大,其中一些功能是由linux内核版本来支持的.通过chattr命令修改属性能够提高系统的安全性,但是它并不适合所有的目录.lsattr是 ...
- C语言的学习-基础知识点
---BOOL BOOL BOOL a = YES; printf("%d\n", a); a = NO; printf("%d", a); , b = ; B ...