当前位置: 首页 > news >正文

用专业的网络技术制作网站百度平台商家订单查询

用专业的网络技术制作网站,百度平台商家订单查询,东莞多语言网站建设,旅游网站建设价格QT开发之路 企业级开发系列文章,主要目标快速学习、完善、提升 相关技能 高效完成企业级项目开发 分享在企业中积累的实用技能和经验。 通过具体的编码过程、代码示例、步骤详解、核心内容和展示的方法解决遇到的实际问题。 阅读前声明 本系列文章属于付费内容 禁止…

        QT开发之路 企业级开发系列文章,主要目标快速学习、完善、提升 相关技能 高效完成企业级项目开发 分享在企业中积累的实用技能和经验。

        通过具体的编码过程、代码示例、步骤详解、核心内容和展示的方法解决遇到的实际问题。

 阅读前声明 本系列文章属于付费内容 禁止转载、复制、抄袭 仅限付费读者阅读参考。

QT 多语言转换 ts、qm

1 运行环境

2 命令用法

3 软件界面

4 vs配置

5 .h代码

6 .cpp代码

7 其它

8 en.ts

9 xf.ts

10 zh.ts

11 其它文章


1 运行环境

         VS2017+QT

2 命令用法

lupdate 更新翻译文件        生成 .ts 文件

用法:

lupdate ./ -ts language/QLinguist_en.ts language/QLinguist_zh.ts language/QLinguist_xf.tslanguage/QLinguist_en.ts //language/目录 按照实际需求更改

lrelease 发布更新文件        生成 .qm 文件

用法:

lrelease language/QLinguist_en.ts language/QLinguist_zh.ts language/QLinguist_xf.tslanguage/QLinguist_en.ts // language/ 目录 按照实际需求更改

3 软件界面

4 vs配置

        项目-> 属性->生成事件->生成后事件->输入

lupdate ./ -ts language/QLinguist_en.ts language/QLinguist_zh.ts language/QLinguist_xf.ts
lrelease language/QLinguist_en.ts language/QLinguist_zh.ts language/QLinguist_xf.ts

5 .h代码

#pragma once#include <QtWidgets/QMainWindow>
#include "ui_QLinguist.h"
#include <QTranslator>
#include <QDebug>#pragma execution_character_set("utf-8")
class QLinguist : public QMainWindow
{Q_OBJECTpublic:QLinguist(QWidget *parent = nullptr);~QLinguist();private slots:void on_ActionTriggered();void on_ActionXf_Triggered();void on_ActionEn_Triggered();private:Ui::QLinguistClass ui;QString strFilePath = "";QTranslator zh;QTranslator xf;QTranslator en;
};

6 .cpp代码

#include "QLinguist.h"QLinguist::QLinguist(QWidget *parent): QMainWindow(parent)
{ui.setupUi(this);setWindowTitle("多语言切换Demo CSDN 双子座断点 V1.0 https://blog.csdn.net/qq_37529913?type=blog");strFilePath = "C:/Users/dream/source/repos/QLinguist/QLinguist/language/";zh.load(strFilePath + "QLinguist_zh.qm");xf.load(strFilePath + "QLinguist_xf.qm");en.load(strFilePath + "QLinguist_en.qm");connect(ui.action, SIGNAL(triggered()), SLOT(on_ActionTriggered()));connect(ui.action_2, SIGNAL(triggered()), SLOT(on_ActionXf_Triggered()));connect(ui.action_3, SIGNAL(triggered()), SLOT(on_ActionEn_Triggered()));}QLinguist::~QLinguist()
{}void QLinguist::on_ActionTriggered() 
{qDebug() << ".....";qApp->installTranslator(&zh);ui.retranslateUi(this);
}void QLinguist::on_ActionXf_Triggered()
{qDebug() << ".....";qApp->installTranslator(&xf);ui.retranslateUi(this);
}void QLinguist::on_ActionEn_Triggered()
{qDebug() << ".....";qApp->installTranslator(&en);ui.retranslateUi(this);
}

7 其它

void QLinguist::on_ActionEn_Triggered()
{qDebug() << ".....";//qApp->installTranslator(&en);//ui.retranslateUi(this);//ui.lineEdit->setText(tr("图像路径为空!"));
}

8 en.ts

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context><name>QLinguist</name><message><location filename="../QLinguist.cpp" line="51"/><source>图像路径为空!</source><translation type="unfinished">The image path is empty!</translation></message>
</context>
<context><name>QLinguistClass</name><message><location filename="../QLinguist.ui" line="14"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="227"/><source>多语言切换Demo CSDN 双子座断点 V1.0 https://blog.csdn.net/qq_37529913?type=blog</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="29"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="204"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="231"/><source>图像路径:</source><translation type="unfinished">image path:</translation></message><message><location filename="../QLinguist.ui" line="62"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="205"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="232"/><source>曝光:</source><translation type="unfinished">Exposure:</translation></message><message><location filename="../QLinguist.ui" line="95"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="206"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="233"/><source>增益:</source><translation type="unfinished">gain:</translation></message><message><location filename="../QLinguist.ui" line="128"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="207"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="234"/><source>区域:</source><translation type="unfinished">roi:</translation></message><message><location filename="../QLinguist.ui" line="161"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="208"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="235"/><source>串口:</source><translation type="unfinished">com:</translation></message><message><location filename="../QLinguist.ui" line="236"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="209"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="237"/><source>语言选择</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="246"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="201"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="228"/><source>简体中文</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="251"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="202"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="229"/><source>繁体中文</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="256"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="203"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="230"/><source>English</source><translation type="unfinished"></translation></message><message><location filename="../x64/Debug/uic/ui_QLinguist.h" line="200"/><source>QLinguist</source><translation type="unfinished"></translation></message>
</context>
</TS>

9 xf.ts

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context><name>QLinguist</name><message><location filename="../QLinguist.cpp" line="51"/><source>图像路径为空!</source><translation type="unfinished">圖像路徑為空!</translation></message>
</context>
<context><name>QLinguistClass</name><message><location filename="../QLinguist.ui" line="14"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="227"/><source>多语言切换Demo CSDN 双子座断点 V1.0 https://blog.csdn.net/qq_37529913?type=blog</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="29"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="204"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="231"/><source>图像路径:</source><translation type="unfinished">圖像路徑:</translation></message><message><location filename="../QLinguist.ui" line="62"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="205"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="232"/><source>曝光:</source><translation type="unfinished">曝光:</translation></message><message><location filename="../QLinguist.ui" line="95"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="206"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="233"/><source>增益:</source><translation type="unfinished">增益:</translation></message><message><location filename="../QLinguist.ui" line="128"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="207"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="234"/><source>区域:</source><translation type="unfinished">區域:</translation></message><message><location filename="../QLinguist.ui" line="161"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="208"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="235"/><source>串口:</source><translation type="unfinished">串口:</translation></message><message><location filename="../QLinguist.ui" line="236"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="209"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="237"/><source>语言选择</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="246"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="201"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="228"/><source>简体中文</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="251"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="202"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="229"/><source>繁体中文</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="256"/><location filename="../x64/Debug/uic/ui_QLinguist.h" line="203"/><location filename="../x64/Release/uic/ui_QLinguist.h" line="230"/><source>English</source><translation type="unfinished"></translation></message><message><location filename="../x64/Debug/uic/ui_QLinguist.h" line="200"/><source>QLinguist</source><translation type="unfinished"></translation></message>
</context>
</TS>

10 zh.ts

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context><name>QLinguist</name><message><location filename="../QLinguist.cpp" line="49"/><source>图像路径为空!</source><translation type="unfinished">图像路径为空!</translation></message>
</context>
<context><name>QLinguistClass</name><message><location filename="../QLinguist.ui" line="14"/><source>多语言切换Demo CSDN 双子座断点 V1.0 https://blog.csdn.net/qq_37529913?type=blog</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="29"/><source>图像路径:</source><translation type="unfinished">图像路径:</translation></message><message><location filename="../QLinguist.ui" line="62"/><source>曝光:</source><translation type="unfinished">曝光:</translation></message><message><location filename="../QLinguist.ui" line="95"/><source>增益:</source><translation type="unfinished">增益:</translation></message><message><location filename="../QLinguist.ui" line="128"/><source>区域:</source><translation type="unfinished">区域:</translation></message><message><location filename="../QLinguist.ui" line="161"/><source>串口:</source><translation type="unfinished">串口:</translation></message><message><location filename="../QLinguist.ui" line="236"/><source>语言选择</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="246"/><source>简体中文</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="251"/><source>繁体中文</source><translation type="unfinished"></translation></message><message><location filename="../QLinguist.ui" line="256"/><source>English</source><translation type="unfinished"></translation></message>
</context>
</TS>

11 其它文章

http://www.15wanjia.com/news/29145.html

相关文章:

  • 商标设计在线生成器潍坊seo外包平台
  • 杭州专业做网站的公司有哪些线上免费推广平台都有哪些
  • 网站做中英文切换免费发帖推广的平台
  • 80端口被封怎么做网站独立网站怎么做
  • 阿里巴巴国际站b2b平台微信推广怎么弄
  • 体育类网站开发陕西整站关键词自然排名优化
  • 做seo学网站网站如何被百度快速收录
  • 利用路由器做网站产品怎么进行推广
  • 网站建设只有20%的利润百度怎么免费推广自己的产品
  • 个人做网站的必要性电商网店
  • vs2013可以做网站么谷歌排名
  • 刷题小程序制作平台广州灰色优化网络公司
  • 公司网站建设的方案百度快照优化培训班
  • 河北建设集团有限公司网站网络推广中心
  • 哪个网站做的最好怎样在百度上发布免费广告
  • 服务器网站建设流程秦皇岛网站seo
  • 公司网站托管东莞seo网络营销
  • 做汽车配件外贸用什么网站关键字排名查询
  • 黔江网站制作北京做网站公司哪家好
  • php 网站建设方案详情页页面页面
  • 南通做网站多少钱电子商务营销
  • 网站建设需要交文化建设税吗抖音营销软件
  • 宝丰网站建设潍坊网站收录
  • 做卖车的网站有哪些百度快照怎么做
  • 泸州市住房和城乡建设局网站策划方案怎么做
  • 奥一农场的网站开发seo软件优化
  • 网站建设深圳赶集网桂林最新消息今天
  • 郑州专业做网站公司专注网络营销推广公司
  • 上海网站备案成功品牌策划案例
  • app开发网上app开发宁波优化推广选哪家