Qt 5.5 tr usage
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的更多相关文章
- 关于qt中的tr()函数
关于qt中的tr()函数 在论坛中漂,经常遇到有人遇到tr相关的问题.用tr的有两类人: (1)因为发现中文老出问题,然后搜索,发现很多人用tr,于是他也开始用tr (2)另一类人,确实是出于国际化的 ...
- QT显示歌词渐变
central = new QWidget(this); setCentralWidget(central); central->setAutoFillBackground(true); cen ...
- 【QT】C++ GUI Qt4 学习笔记3
菜单界面的实现. 看书上第三章,好长,好多代码.我敲了半天,想看看效果,结果却显示不出来.仔细一看,发现spreadsheet的实现在第四章.郁闷.... 又到官网上下代码,结果居然不能运行.难道是因 ...
- 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 ...
- Qt操作Oracle
很久以前写过<Qt数据库操作>的一篇文章,在操作数据库的时候,温习了一下!感觉很好!但在操作Oracle数据库时又遇到了一些问题.在使用QSqlRelationalTableModel操纵 ...
- Qt根据汉字生成位图,可连续调用,生成的位图不会有杂点
void MainWindow::drawText(int font_size, QString str, int n){ QPainter p; QSize size(460, font_size) ...
- 1.总结---tr()和QTextCodec对象
1. 关于Qt 中的tr()函数-------http://tscsh.blog.163.com/blog/static/200320103201310213312518/ 在论坛中漂,经常遇到有人遇 ...
- QT 操作数据库
整理一下 QT 操作数据库的一些要点,以备以后的查询学习(主要是操作 mysql ). 首先,要查询相关的驱动是否已经装好了,可以用以下的程序进行验证: #include <QtCore/QCo ...
- [Qt] searchBox 搜索框实现
[Qt] searchBox 搜索框实现 也就是在lineEdit中加入button.在搜索框的右边会有个小小的搜索图标,输入内容之后,搜索的图标会变成叉叉. 类中的IconHelper见我的另一篇博 ...
随机推荐
- React - Stores
Event emmiters that make data available, handle business logic, send events to React, and listen for ...
- iptables允许FTP
在iptables里设置允许访问ftp(建立连接,数据传输) 由于ftp服务在建立连接和传输数据时,使用的时不同的端口,建立连接的端口20.21,数据传输的端口可以自定义: 修改ftp配置文件,指定用 ...
- ActiveMQ in Action(4) - Security
关键字: activemq 2.4 Security ActiveMQ支持可插拔的安全机制,用以在不同的provider之间切换.2.4.1 Simple Authentication Plug ...
- CodeForces 697B Barnicle 模拟
强行模拟 纪念一下…… #include<stdio.h> #include<iostream> #include<algorithm> #include<m ...
- Java comparable 和 comparator
一.comparator 接口继承 public class ComparatorTest { /** * @param args */ public static void main(String[ ...
- 洛谷-陶陶摘苹果(升级版)-BOSS战-入门综合练习1
题目描述 Description 又是一年秋季时,陶陶家的苹果树结了n个果子.陶陶又跑去摘苹果,这次她有一个a公分的椅子.当他手够不着时,他会站到椅子上再试试. 这次与NOIp2005普及组第一题不同 ...
- Openjudge-计算概论(A)-鸡兔同笼
描述一个笼子里面关了鸡和兔子(鸡有2只脚,兔子有4只脚,没有例外).已经知道了笼子里面脚的总数a,问笼子里面至少有多少只动物,至多有多少只动物输入第1行是测试数据的组数n,后面跟着n行输入.每组测试数 ...
- 3.编写Java应用程序。首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”、“取款”和“余额查询”。其次, 编写一个主类,在主类中测试Account类的功能。
Account package com.hanqi.test; public class Account { private String zhanghao;private double yve; A ...
- 当用反射获取一个model,这个model里面字段有nullable的时候,获取字段真实类型
Using Reflection to Determine whether an Type is Nullable And Get the underlying Type /// <summar ...
- [Mark] openvswitch megaflow
Megaflow is an OpenVSwitch (OVS) feature than enables us to install flows for which some fields are ...