Hi, All
I am a newbie for developing application of QtEmbedded. I have ported the Qte4.5.3 to ARM board. Now, I need the arm board displays chinese chars with wenquanyi font, and put these fonts to /usr/local/Trolltech/QtEmbedded-4.5.3-arm path directerly. In my source code, I call some functins as below:
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QFont myFont;
myFont.setPointSize(26);
myFont.setFamily(("wenquanyi"));
app.setFont(myFont);
QTextCodec::setCodecForTr(QTextCodec::codecForName ("utf-8"));
QWidget* pWidget = new QWidget;
QLabel myLabel(pWidget);
pWidget->showMaximized();
myLabel.setText(QObject::tr("X X X X"));
QPushButton* pButton = new QPushButton(QObject::tr("Close"), pWidget);
QVBoxLayout* pLayout = new QVBoxLayout;
pLayout->addWidget(&myLabel);
pLayout->addWidget(pButton);
pWidget->setLayout(pLayout);
QObject::connect(pButton, SIGNAL(clicked()), pWidget, SLOT(close()));
pWidget->show();
return app.exec();
}
The red partion are chinese chars. They can not display on the screen.
Can anyone help me if there are some wrongs in my implementment?
Thanks
Best regards
Jason
Bookmarks