in .cpp file, wherever you want, wrap QString with a tr("somesz") rendering it ready to be translated.

in .pro file, specify the readable translation file:

 //*.pro
TRANSLATIONS += *tr_chn.ts
TRANSLATIONS += *tr_la.ts
...

in the project location, call the lupdate.exe in the the desired version folder's bin:

 lupdate *.pro

generated *tr_*.ts file, open them as .txt file, modify the XML formatted file:

 <!--from:-->
<translation type="Unfinished"></translation>
<!--to:-->
<translation>Translated Chars</translation>

in the project location, call the lrelease.exe in the desired version folder's bin as:

 lrelease.exe *tr_*.ts

copy the generated *tr_*.qm file to the release folder with the main application and done.

Qt 5.5 tr usage的更多相关文章

  1. 关于qt中的tr()函数

    关于qt中的tr()函数 在论坛中漂,经常遇到有人遇到tr相关的问题.用tr的有两类人: (1)因为发现中文老出问题,然后搜索,发现很多人用tr,于是他也开始用tr (2)另一类人,确实是出于国际化的 ...

  2. QT显示歌词渐变

    central = new QWidget(this); setCentralWidget(central); central->setAutoFillBackground(true); cen ...

  3. 【QT】C++ GUI Qt4 学习笔记3

    菜单界面的实现. 看书上第三章,好长,好多代码.我敲了半天,想看看效果,结果却显示不出来.仔细一看,发现spreadsheet的实现在第四章.郁闷.... 又到官网上下代码,结果居然不能运行.难道是因 ...

  4. Qt数据库操作(qt-win-commercial-src-4.3.1,VC6,Oracle,SQL Server)

    qt-win-commercial-src-4.3.1.qt-x11-commercial-src-4.3.1Microsoft Visual C++ 6.0.KDevelop 3.5.0Window ...

  5. Qt操作Oracle

    很久以前写过<Qt数据库操作>的一篇文章,在操作数据库的时候,温习了一下!感觉很好!但在操作Oracle数据库时又遇到了一些问题.在使用QSqlRelationalTableModel操纵 ...

  6. Qt根据汉字生成位图,可连续调用,生成的位图不会有杂点

    void MainWindow::drawText(int font_size, QString str, int n){ QPainter p; QSize size(460, font_size) ...

  7. 1.总结---tr()和QTextCodec对象

    1. 关于Qt 中的tr()函数-------http://tscsh.blog.163.com/blog/static/200320103201310213312518/ 在论坛中漂,经常遇到有人遇 ...

  8. QT 操作数据库

    整理一下 QT 操作数据库的一些要点,以备以后的查询学习(主要是操作 mysql ). 首先,要查询相关的驱动是否已经装好了,可以用以下的程序进行验证: #include <QtCore/QCo ...

  9. [Qt] searchBox 搜索框实现

    [Qt] searchBox 搜索框实现 也就是在lineEdit中加入button.在搜索框的右边会有个小小的搜索图标,输入内容之后,搜索的图标会变成叉叉. 类中的IconHelper见我的另一篇博 ...

随机推荐

  1. Java IO 过滤流 BufferedInput/OutputStream

    Java IO 过滤流 BufferedInput/OutputStream @author ixenos 概念 BufferedInput/OutputStream是实现缓存的过滤流,他们分别是Fi ...

  2. iptables允许FTP

    在iptables里设置允许访问ftp(建立连接,数据传输) 由于ftp服务在建立连接和传输数据时,使用的时不同的端口,建立连接的端口20.21,数据传输的端口可以自定义: 修改ftp配置文件,指定用 ...

  3. lua中获取时间

    os.date()    返回  XX/XX/XX XX:XX:XX 月/日/年    时:分:秒 os.time()   返回的是从1970年1月1日到现在的经过的秒数. 例如: print(os. ...

  4. 关于 JAVA 中使用 Preferences 读写注册表时要注意的地方

    要注意的只有一个地方,那就是键名或者项名不要包含大写字母,否则读不到数据. 代码是这样的: 1: Preferences preferences = Preferences.systemRoot(); ...

  5. js 日期格式化 函数

    function formatDate(date,format){ var paddNum = function(num){ num += ""; return num.repla ...

  6. chapter 14_1 环境

    Lua将其所有的全局变量保存在一个常规的table中,称为“global environment”. Lua将环境table自身保存在一个全局变量_G中,_G._G等于 _G . 比如下面的代码打印出 ...

  7. spring 集成mongo配置

    spring继承Mongo使用的是spring-data. 如果需要加入两个mongo与spring集成的包,spring-data-commons-1.7.0.RELEASE.jar,spring- ...

  8. Cash Machine

    Problem Description A Bank plans to install a machine for cash withdrawal. The machine is able to de ...

  9. 利用NSURLSession完成的断点续传功能

    首先是业务中的.h文件 #import <UIKit/UIKit.h> #import "DenglSingleton.h" @protocol DownLoadVCd ...

  10. js对象,类

    js闭包网站:http://www.cnblogs.com/qieguo/p/5457040.html 有权访问另一个函数作用域内变量的函数都是闭包. 这里 inc 函数访问了构造函数 a 里面的变量 ...