buildroot 移植参考文章
buildroot配置安装qt5
在buildroot下面,打开配置界面
make menuconfig
选择target packages项
找到QT5 勾选
进入QT5选项,勾选gui module 和 widgets module。
buildroot编译安装tslib
执行make menuconfig
Target packages —>
Graphic libraries and applications (graphic/text) —>
[] Qt5 —>
[] Enable Tslib support
或者qt–>Mouse drivers —>tslib
编译成功后下载到开发板或nfs mount过去执行ts_calibration校正看看是否可以.
开发板配置
buildroot 配置中tslib使能后,在 /etc/profile中加入以下内容。
#!/bin/sh
export T_ROOT=/usr/tslib4arm #目录
export TSLIB_TSDEVICE=/dev/input/event1 #触摸屏设备文件
export TSLIB_CALIBFILE=/etc/pointercal #指定触摸屏校准文件pintercal的存放位置
export TSLIB_CONFFILE=/etc/ts.conf #tslib模块配置文件
export TSLIB_PLUGINDIR=/usr/lib/ts/ #tslib插件库目录
export TSLIB_CONSOLEDEVICE=/dev/tty
export TSLIB_FBDEVICE=/dev/fb0 #framebuffer设备文件
echo "tslib init success!"
#生效
source /etc/profile
如果没有设置上面环境变量将出现以下错误:
错误1:tslib: Selected device is not a touchscreen (must support ABS_X and ABS_Y events
错误2:ts_open: No such file or directory
执行QT程序:
./analogclock -platform linuxfb
如果执行./analogclock出现如下错误:
could not find or load the Qt platform plugin "xcb"
或者 could not find or load the Qt platform plugin "eglfs"
在后面加 -platform linuxfb,即可执行。
找不到字体库解决方法
# ./qt_test_app -platform linuxfbQFontDatabase: Cannot find font directory /usr/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /usr/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /usr/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /usr/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /usr/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
去Windows路径C:\Windows\Fonts下拷贝字体(ttf后缀)到目标平台/usr/lib/fonts下即可。