如何在Visual Studio Qt项目中包含C:\ Qt \ 5.9.1 \ msvc2015 \ translations .qm文件(Qt框架qm文件)? [英] How can I include C:\Qt\5.9.1\msvc2015\translations .qm files (Qt framework qm files) in Visual Studio Qt project?

查看:216
本文介绍了如何在Visual Studio Qt项目中包含C:\ Qt \ 5.9.1 \ msvc2015 \ translations .qm文件(Qt框架qm文件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在最终版本Visual Studio Qt项目中包含C:\ Qt \ 5.9.1 \ msvc2015 \ translations .qm文件(Qt框架qm文件)?

How can I include C:\Qt\5.9.1\msvc2015\translations .qm files (Qt framework qm files) in final release, Visual Studio Qt project?

我正在使用以下文件加载文件:

I am loading the files using:

    QTranslator* qtTranslator = new QTranslator();
bool ok = qtTranslator->load("qt_" + language, QLibraryInfo::location(QLibraryInfo::TranslationsPath));

在发布和调试翻译工作中,但是在最终版本中却没有,并且很可能是因为未添加.

in release and debug the translations work, but in the final build they don't and it is most probable that it's because they are not added.

我注意到,如果我在项目中移动它们,它们将不会被加载.

I noticed that if i move them in my project they are not loaded.

推荐答案

qt框架转换文件必须与qt_xx.qm一起添加到项目转换文件夹中,并且必须添加相应的qm依赖项文件.

qt framework translation files have to be added in the project translations folder together with qt_xx.qm, the correspondent qm dependency files have to be added.

qt_xx.qm仅包含这些文件的名称-还有一个答案可以在此处解释:

qt_xx.qm contains only the name of those files - there is another answer explaining this here: Translations of QMessageBox not work in Qt5.3

这篇关于如何在Visual Studio Qt项目中包含C:\ Qt \ 5.9.1 \ msvc2015 \ translations .qm文件(Qt框架qm文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆