请教各位大侠,我用的 qt-embedded-linux-opensource-src-4.5.2 编译成x86平台上版本,配合qvfb
配置参数如下:
./configure -prefix /usr/local/Trolltech/QtEmbedded-4.5.2-x86 -release -static -no-fast -no-largefile -xplatform qws/linux-x86-g++ -qt-sql-sqlite -no-qt3support -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-rpath -silent -optimized-qmake -embedded x86 -little-endian -qt-freetype -depths 16,24,32 -no-separate-debug-info -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb
然后我写了这样一个测试程序:
main.cpp:
#include <QtGui/QApplication>
#include "trantest.h"
#include <QTranslator>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTranslator translator;
translator.load("yun.qm");
a.installTranslator(&translator);
trantest w;
w.show();
return a.exec();
}
trantest.cpp
#include "trantest.h"
#include "ui_trantest.h"
trantest::trantest(QWidget *parent)
: QDialog(parent), ui(new Ui::trantestClass)
{
ui->setupUi(this);
ui->lb_tranTest->setText(tr("yun")); //使用label显示
}
使用lupdate生成yun.ts,将其中"yun”翻译为“晕”
使用lrelease生成yun.qm
编译执行,界面上不显示任何字符
后又将“晕”改为其他英文字符,执行程序可以正确显示
另外使用几乎相同的配置选项配置的arm版本qt/embedded却可以正常显示中文
实在是不解……
如有遇到这种情况的高手请给予指导,先感谢各位了~~!!!!