1) 要安装 g++
2) config qt
./configure -prefix /home/wqs/work/omap3530/sbc8100/rootfs -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omap3530-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast -qt-mouse-tslib
3) make
4) ts
#
# qmake configuration for building with arm-linux-g++
#
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
# modifications to g++.conf
#QMAKE_CC = arm-linux-gcc
#QMAKE_CXX = arm-linux-g++
#QMAKE_LINK = arm-linux-g++
#QMAKE_LINK_SHLIB = arm-linux-g++
#Toolchain
#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
# modifications to linux.conf
#QMAKE_AR = arm-linux-ar cqs
#QMAKE_OBJCOPY = arm-linux-objcopy
#QMAKE_STRIP = arm-linux-strip
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip
QMAKE_INCDIR = /home/wqs/work/omap3530/tslibbin/include
QMAKE_LIBDIR = /home/wqs/work/omap3530/tslibbin/lib
load(qt_config)
同时支持touch mouse :
需要添加环境变量:export QWS_MOUSE_PROTO='usb:/dev/input/event2 tslib:/dev/input/event1'
修改font 的路径:
QT_QWS_FONTDIR
nfs:
setenv bootargs console=ttyS2,115200n8 noinitrd rw root=/dev/nfs rootdelay=2 nfsroot=192.200.1.151:/home/wqs/work/omap3530/sbc8100/rootfs,nolock ip=dhcp video=omapfb:mode:7inch_LCD
setenv bootargs console=ttyS2,115200n8 ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs video=omapfb:mode:7inch_LCD
转:
在前面tslib1.0移植完成的基础上我们可以开始QT的移植,以下步骤经测试在4.6.2、4.6.3、4.7.0、4.7.2平台上均可顺利通过
下载地址:
把下面文档中相应的数字改为对应的版本即可
step 1:
echo yes |../qt-everywhere-opensource-src-4.7.0/configure -opensource -release -fast -embedded arm -xplatform qws/linux-arm-g++ -depths 8,16,32 -no-stl -no-qt3support -no-nis -no-cups -no-iconv -no-qdbus -make libs -nomake docs -qt-freetype -qt-sql-sqlite -qt-kbd-tty -qt-libtiff -qt-libjpeg -qt-gif -qt-libpng -continue -silent -no-mouse-linuxtp -qt-mouse-tslib-I/home/dengwei/QT_test/tslib_src/tslib-1.0/tslib1.0_target/include -L/home/dengwei/QT_test/tslib_src/tslib-1.0/tslib1.0_target/lib
注意:带红色的字体部分要改成对应的目录 -I /-L 指定前面编译出的tslib的路径
#make
#make install
/*会安装库、字体等文件到/usr/local/Trolltech/QtEmbedded-4.7.2-arm目录。*/
注意:编译之前使用 unset CC 取消CC变量的定义,否则编译会出错
step 2:
拷贝/usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib目录下的以下文件到根文件系统/usr/lib目录下:
#cp -a /usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib/*so* rootfs/usr/lib
(也可以不用全部拷贝,可以根据需要进行拷贝,这里为了方便我们全拷贝过去)
step 3:
在根文件系统下建立目录
#mkdir /usr/lib/fonts
将QtEmbedded-4.7.0-arm/lib/fonts目录下的字体unifont_160_50.qpf拷到开发板对应的目录
#cp /usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib/fonts/unifont_160_50.qpf /usr/local
step 4:
使QT支持jpg格式的图片
cp /usr/local/Trolltech/Qt-4.7.0/plugins/imageformats/* /usr/lib/
同时在应用程序main程序中加入 app.addLibraryPath("/usr/lib/");
step 5:修改环境变量及LCD驱动连接
修改 /etc/profile文件,增加以下声明:
export set QWS_MOUSE_PROTO="TSLIB:/dev/event0 Intellimouse:/dev/mouse0" #鼠标键盘均支持
export QWS_SIZE=320x240 #根据屏幕分辨率改成对应的值
export QWS_DISPLAY="LinuxFb:/dev/fb0:mmWidth35:mmHeight45:0" #设置屏幕参数
export set QT_QWS_FONTDIR=$/usr/lib/fonts/ #字体库环境变量
step 6:
拷贝一个应用程序到根文件系统的/home目录下,
#cp QtEmbedded-4.7.0-arm/examples/animation/appchooser
#./ appchooser -qws
程序在显示屏上显示窗口。
阅读(1663) | 评论(0) | 转发(1) |