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

Qt窗体ui如何设置中英文翻译?

ui拖入控件label
Qt–菜单栏–View–Widget Box–label–拖入form1.ui

form1.cpp

QString sdata = this->readText("Hi");
this->label->setText(sdata);

chs.ts

<context>
    <name>form1</name>
    <message>
      <source>Hi</source>
      <translation>你好!</translation>
      <chars>10</chars>
    </message>
</context>

eng.ts

<context>
    <name>form1</name>
    <message>
      <source>Hi</source>
      <translation>Hello!</translation>
      <chars>10</chars>
    </message>
</context>

http://www.kler.cn/news/360897.html

相关文章:

  • 单链表的建立
  • 软考(网工)——网络操作系统与应用服务器
  • AWTK fscript 中的 object 扩展函数
  • 函数(c语言进阶)
  • YOLOv11改进策略【模型轻量化】| 替换骨干网络 CVPR-2024 StarNet,超级精简高效的轻量化模块
  • D45【python 接口自动化学习】- python基础之类
  • 水果忍者网页版(重制版)
  • 【Linux】Linux命令行与环境变量
  • docker配置镜像源
  • Java面试宝典-并发编程学习02
  • Android IP路由策略和防火墙
  • 什么是全局污染?怎么避免全局污染?
  • 基准线markLine的值超过坐标轴范围导致markline不显示
  • Go-知识依赖Vendor
  • 025 elasticsearch索引管理-Java原生客户端
  • 【MySQL】提高篇—索引与性能优化:索引的概念与类型(单列索引、复合索引、全文索引)
  • 手机功耗技术领域
  • Hadoop 踩坑汇总
  • Clip 模型实现文搜图
  • web网页QQ登录