Sometimes it is miserable to find thatRelease VersionOf your software hasGarbage charactersAndErrors in Images.
Here isGood SolutionWhich has been tested to be OK.
1. InMain ()Function of your program, add thisAt the very beginning:
Qapplication: addlibrarypath ("./plugins ");
If it were not added at the very beginning of the program, the following program wocouldNotBe able to find the Plugins needed.
2.Create a new folderIn the release folder named"Plugins"Which will be used to hold the plugins that we need.
3. Go to the directory where your QT is installed. FindPlugins folder.
Mine is "D: \ qtsdk \ Desktop \ QT \ 4.7.4 \ mingw \ plugins"
4. Now you can see several folders: accessible, bearer, codecs, designer, graphicssystems ,...
5.CopyThe folderCodecsAndImageformatsTo the folder that we created before.
We have to copy the folder with all files.
If we just copies all the files but the folder that hold it, it will not work.
6.Set fontsIn the Code:
Qtextcodec * codec = qtextcodec: codecforname ("gb2312"); qtextcodec: codec (codec); qtextcodec: setcodecfortr (codec );
7. Now you can use Chinese and imagines with no trouble!