PDA

View Full Version : The application title can not display the right string in AIX 5.3.0.0



cspp
14th April 2010, 12:21
Hello everyone:
I have some trouble when I setWindowTitle in AIX.
my platform is:
OS: AIX 5.3.0.0
Qt: 4.5.2
When I use QWidget::setWindowTitle( tr("标题栏"));
of course, the title name is in chinese especially.
and when I run the applicatoin,the windows title can not display right.
the title string is show like "A ".

but the same code in AIX 6.2.1.0 or other linux OS is right!
so I don't know how to resolve it?

if i just user the Qt example like examples/widgets/lineedits
I rewrite the code in window.cpp:


Window::Window()
{
//....
QLabel *echoLabel = new QLabel(tr("Mode:"));
QString strLabel = QString("模式");
echoLabel->setText(strLabel);
//....
QString strTitle = QString("标题栏");
setWindowTitle(strTitle);
}


and in main.cpp:


int main(int argc, char *argv[])
{
QTextCodec* codec= QTextCodec::codecForName("GB2312");
QTextCodec::setCodecForTr(codec);
QTextCodec::setCodecForLocale(codec);
QTextCodec::setCodecForCStrings(codec);

QApplication app(argc, argv);
Window window;
window.show();
return app.exec();
}


Then i run the lineedits application:
just the title show "A "
and the label is ok!