您的位置:首页 > 编程语言 > Qt开发

向Tiny6410移植QT4.7.0版本

2016-04-16 08:58 555 查看
在移植QT之前我们首先要安装tslib,没有移植的可以看这篇文章移植。
http://www.cnblogs.com/ynxf/p/5392476.html
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 /-L 指定前面编译出的tslib的路径

用下面的代码效果更好:

echo yes | ./configure -opensource -embedded arm -xplatform qws/linux-arm-g++  -webkit -qt-gfx-transformed -qt-libtiff -qt-libmng  -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp -no-neon


#make

#make install


/*会安装库、字体等文件到/usr/local/Trolltech/QtEmbedded-4.7.2-arm目录。*/

注意:编译之前使用 unset CC 取消CC变量的定义,否则编译会出错

[b]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:
[/b]

在根文件系统下建立目录

#mkdir /usr/local/fonts



将QtEmbedded-4.7.0-arm/lib/fonts目录下的字体unifont_160_50.qpf拷到开发板对应的目录

[b]#cp
/usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib/fonts/*
/usr/local/[b]fonts
-a[/b]
[/b]

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=[b]"tslib:/dev/touchscreen-1wire Intellimouse:/dev/mouse1"#鼠标键盘均支持

export QWS_SIZE=800x480 #根据屏幕分辨率改成对应的值

export QWS_DISPLAY="LinuxFb:/dev/fb0:mmWidth150:mmHeight250:0" #设置屏幕参数

export set QT_QWS_FONTDIR=/usr/lib/fonts/ #字体库环境变量 [/b]

[b]export set QWS_KEYBOARD="TTY:/dev/tty1" [/b]

step 6:


拷贝一个应用程序到根文件系统的/home目录下,

#cp QtEmbedded-4.7.0-arm/examples/animation/appchooser

#./ appchooser -qws

程序在显示屏上显示窗口。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: