PDA

View Full Version : Pack all .qm files into .qrc, why doesn't work???



yxmaomao
7th May 2008, 07:40
I work with Qt4.3.2 + VSS .net 2005
I want to make my software cleaning, so I pack all .qm file into .qrc file like this:
myqpp.qrc
-------------
<rcc>
<qresource>
<file>translations/myapp_en.qm</file>
<file>translations/myapp_zh.qm</file>
</qresource>
</rcc>

Now in my application, when I call load translation file like below:
QTranslator translator;
bool bTranslator = translator.load(":/translations/myapp_zh");
here always load failed , false returned

could any guy give me some guide?

yxmaomao
8th May 2008, 05:17
Anyone haven't been met this problem before?

DeepDiver
8th May 2008, 11:16
have you tried to use the prefix attribute?
like:
<qresource prefix="/" >

CU

roxton
8th May 2008, 20:38
Check is resource file is listed at the .pro file.