This article is mainly to solve the interface program compile and run after the problem can not display Chinese, if in creater can not input Chinese, download a ibus or sogou, such as Chinese input method can be solved!
First of all, the problem of garbled, this is a good solution:
If it is under the Linux open Windows under the project garbled, choose the code as "GB2312" Can!
Now the main point is that the program can not be displayed after the Chinese or garbled, the problem has been plagued by this issue for a long time, online to see a lot of information posts are not resolved, all the added are added have no way,
Http://bbs.csdn.net/topics/390610841?page=1 follow all the methods in this post to solve the problem is not successful.
I use the version is QT-EVERYWHERE-OPENSOURCE-SRC installed 4.8.1 and 4.8.5, just started to install is 8.5, see the post there is said to appear unable to display Chinese is this version of the bug, so installed a 8.1 but still did not solve
(embarrassed ...). )。 The installation method is: http://blog.csdn.net/willib/article/details/21968937
There is a lack of Chinese fonts on the Internet, but it is not, perhaps just as careless as I am ...
Terminal Open QT configuration: qtconfig
Select fonts, next, please look carefully family: in the font, carefully, in fact, there are Chinese fonts, but it is used pinyin, such as: Fangsong Ti,song Ti, choose one, remember to click on the file
Save the noodles! Such as:
Next, add the header file in the main file #include <qtextcodec>, and then in Qapplication a (argc, argv); After adding QTEXTCODEC::SETCODECFORTR (Qtextcodec::codecforname ("GB2312"));
O, the original only display English can not display Chinese and Chinese characters are solved together!
Summary: A lot of problems, in fact, not as hard as they think, do things carefully!!!