Archive for the ‘Qt’ Category

nokia Qt支持中文方法

Wednesday, December 9th, 2009

参考网络上的资源,总结的一个解决Qt中文支持的方法,还没有仔细深究,暂时记录在这里,当模板使用。 编写一个最简单的Qt程序,参考教材《C++ GUI Qt4编程 第二版》,编译。 #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QLabel *label = new QLabel("hello nokia Qt"); label->show(); return a.exec(); } 编译通过,如图: 这还不够,我们要做的程序必须支持中文,改写一下。 #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); ...

64位centOS 5.3下安装配置Nokia Qt开发环境

Friday, December 4th, 2009

Nokia推出了Qt 4.6,按照官方说的,代码一次编写,到处编译执行。尤其可以在诺基亚本家的symbian和maemo上运行,这倒是很诱惑人呢!Qt 4.6兼容symbian,还有webkit支持,看来尝试一下是很有必要的,前些日子买了一本C++ Qt Ui的书,这些日子看来又有的忙了... ... 本文测试环境为centOS 5.3 x86_64,其他操作系统安装Qt SDK都没有centOS这么费劲,汗! 首先下载Nokia Qt SDK并安装 下载地址:http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp chmod u+x qt-sdk-linux-x86_64-opensource-2009.05.bin ./qt-sdk-linux-x86_64-opensource-2009.05.bin 安装完毕后创建一个Qt gui项目,随便加个label然后编译看看。 编译报错如下: No valid Qt version set. Set one in Tools/Options Error while building project helloworld When executing build step 'QMake' Canceled build. 解决方法,依次选择tools->options->Qt4->qt versions,新加一个Qt versions,如图所示: 点击OK,再次编译。 这次编译报错如下: /home/program/qtsdk-2009.05/qt/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace' collect2: ld returned 1 exit status make: Leaving directory `/home/project/qt/helloworld/helloworld' make: *** [helloworld] Error 1 Exited ...