做了很多次Qt的移植,都没做记录,所以每次都会在几个差不多的问题上浪费很多时间。
写点东西做备份来用
1.qt-arm编译:
下载了 qt-everywhere-opensource-src-4.8.5 ,
写了个脚本添加 : ./configure -force-pkg-config -prefix /opt/qt-4.8.5-arm -embedded arm - release -shared -fast -no-largefile -qt-sql-sqlite -qt3support -no- xmlpatterns -no-glib -no-phonon -no-mmx -no-3dnow -no-sse -no-sse2 -no-svg - webkit -qt-zlib -qt-libtiff -qt-libpng -qt-libjpeg -make libs -nomake examples -nomake docs -nomake demo -no-nis -no-cups -iconv -no-dbus - openssl -xplatform qws/arm-linux-gnueabi-g++ -little-endian -qt-freetype - depths 16,24,32 -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no- gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-kbd-qvfb -armfpa -no-mouse- qvfb -no-pch -qt-mouse-linuxtp -qt-mouse-tslib -DQT_QLOCALE_USES_FCVT -I / root/A20/lichee/buildroot/target/dragonboard/sysroot/usr/include -L /root/ A20/lichee/buildroot/target/dragonboard/sysroot/usr/lib
使用的arm-linux-gcc 4.4.1 在ubuntu12.04 64位下编译报错 , 之后换了32位系统的就OK了
2.qt-creator 安装
使用qt-creator-linux-x86_64-opensource-2.8.1.run 安装完成后添加PC版的Qmake(用的第一个qt 直接./configure && make && make install)
编译出来运行在PC的Qt程序很丑 在终端下 apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt-dev-tools qt4-doc qt4-designer qt4-qtconfig ,可能大部分和之前安装的qt有重复 ,可以尝试下就install qt4-qtconfig
3.arm板配置
ts和大部分的参数网上都很多 , 主要是移植后字体变小, 方法一在Qt程序里使用add.font , 方法二在环境变量添加:
export QWS_DISPLAY="LinuxFb:mmHeight=125:mmWidth=139"
export QWS_SIZE=480*800,我用的是7寸的板子,字体看着差不多。
4.运行
在板子的/etc/profile 添加 xx -qws & , 开机后台自启动运行qt程序