在板子上显示中文
宿主机的环境变量LANG="zh_CN.GBK"
include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <qvbox.h>
#include <qtextcodec.h>
#include <qstring.h>
#include <qobject.h>
int main(int argc, char **argv)
{
QApplication a(argc,argv);
a.setDefaultCodec(QTextCodec::codecForName("GBK"));
QVBox box;
box.resize(200,120);
QCString chinese_string="Í˳ö";
QTextCodec* pcodec=QTextCodec::codecForName("gbk") ;
QPushButton quit(QObject::tr(chinese_string),&box);
quit.setFont( QFont( "unifont", 18, QFont::Bold ) );
QObject::connect(&quit,SIGNAL(clicked()),&a,SLOT(quit()));
a.setMainWidget(&box);
box.show();
return a.exec();
}