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. csu oj Infected Computer 1427

    #include <iostream> #include <algorithm> #include <stdio.h> #define max 20005 #def ...

  2. ubutun下安装jenkins

    安装方法所在网址:   https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu 在安装jenkins之前,ub ...

  3. 2014web面试题

    面试题目会根据你的等级和职位变化,入门级到专家级:范围↑.深度↑.方向↑; 类型: 技术视野.项目细节.理论知识型题,算法题,开放性题,案例题. 进行追问,可以确保问到你开始不懂或者面试官开始不懂为止 ...

  4. WTL中菜单栏及工具栏项状态改变应注意的地方

    WTL中菜单栏项和工具栏按钮的状态可通过UISetCheck(int ITEM_ID, int STATE)进行设置 需要注意的是要将需要改变状态的控件ID添加到UI更新映射中 /* MainFram ...

  5. ios 将图片变成圆形

    #pragma mark - 将图片转换成圆形 -(UIImage*) circleImage:(UIImage*) image withParam:(CGFloat) inset { UIGraph ...

  6. D - 小Y上学记——要迟到了!

    D - 小Y上学记——要迟到了! Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Others) ...

  7. Program Files 与Program Files (x86)

    在64位系统下,为了更好的兼容32位程序,在安装一些32位程序(注意某些程序他就是32位的),会默认扔到program files(x86)这个文件夹下,而一些64位的程序,或程序本身没有位数区别的, ...

  8. 第三题 有如下Student 对象,  private String name;       private int age;       private int score;   private String classNum;  其中,classNum&

    //Student package zuoye; public class Student { private String name; private int age; private int sc ...

  9. Saltstack 服务器基本安装

    Salt介绍 Salt是一个基础平台管理工具 Salt是一个配置管理系统,能够维护预定义状态的远程节点 Salt是一个分布式远程执行系统,用来在远程节点上执行命令和查询数据 Salt核心功能 使命令发 ...

  10. C语言中结构体定义实际上相当于变量入栈

    struct context { int edi; int esi; int ebx; int ebp; int eip;}; 对应的入栈顺序是 pushl %esp pushl %eip pushl ...