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>