Solved Check for QTranslator::load
-
Ok, can you show your .qrc file ?
-
-
Can you show it's text content ?
-
This post is deleted! -
No, the .qrc raw content.
-
-
From there it looks all good.
Just for the sake of debugging, you should check the install and remove calls since they return a Boolean.
-
@SGaist I checked them and they are working fine but after deployment they don't unless I add .qm file to the directory.
-
Did you try to list the content of the .qrc file using QDir at run time just to ensure you have everything in place ?
-
@hbatalha
I feel you missed the second argument for the load function which is the directory path, where as first is the filename.translatorPt.load(":/Languages/transl_portuguese.qm"))
If directory is not specified, the current directory is used (i.e., as currentPath()).
So in deployment it will search for current path for the .qm file. -
@SGaist said in Check for QTranslator::load:
Did you try to list the content of the .qrc file using QDir at run time just to ensure you have everything in place ?
I will do that and get back to you
-
@nagesh but I am loading from resource file, it shouldn't care for the directory of the .qm file in the deployment since the resource files are supposed to be compiled into the .exe file
-
Did you try to list the content of the .qrc file using QDir at run time just to ensure you have everything in place ?
I did, everything seems to fine.
I don't know where I can possibly be doing something wrong. I created another topic dedicated to this problem as this one contains answer that solves the op.
-
-
I have found out what was the problem. For some reason I don't know every time I build the application Qt Creator will create the binary in the debug folder even though I have it set to release.
None of the changes I was making was actually taking effect since I was always checking .exe file from the release which was remaining unchanged the whole time.
So I took the .exe from the debug folder and deployed it and all is working fine. Now I have to check what might me going when building my app cause the .exe is pretty big and I am not sure if is the release or the debug(it is in the debug folder, but I built it with release build set).
I thank you all for the time and patience. I really appreciated it.