http://blog.sina.com.cn/s/blog_5106eff10100p78q.html
1.编译内核时选择
Filesystem--->nature language -----> 1. simple chinese (gb2312) 2.(utf-8)
2.编译filesystem时 buildroot
选择 libiconv这个库文件/或者直接选择i18n后者国际化更好一些
3.下载文泉驿字体
注意把所有的wenquanyi_*.qpf文件拷贝到ARM开发板的字体库中去,我的字体库是/usr/lib/fonts 有的字体库的路径是/usr/local/下的。不过你可以用 $find -name fonts来查找
4.在 /etc/profile环境变量中加入
export QT_QWS_FONTDIR=/usr/lib/fonts,来使得字体环境有效
5.在设计UI的时候注意选择字体 WenQuanYi Micro Hei
6.在程序中需要加入下面代码以使得程序中显示中文有效
QApplication app(argc, argv);
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
QTextCodec *codec = QTextCodec::codecForName("System");
QTextCodec::setCodecForLocale(codec);
QTextCodec::setCodecForCStrings(codec);
QTextCodec::setCodecForTr(codec);
QFont font("wenquanyi",6);
app.setFont(font);