qt触摸屏调试(tslib1.21 + qt5.12.9)

过程是痛苦的,因为之前没调试过qt,也没啥总结的,可能换个设备还是慢慢摸索调试

前文已介绍了如果编译 tslib和qt 且非常详细;那个步骤现在看没有问题
我在调试qt的时候 翻看了好多遍前文编译的库,看编译过程是否有问题;;;;我这不叫写文章 叫笔记

1.配置文件
这个在/etc/profile 中, 对tslib的一些配置;

export TSLIB_ROOT=/路径/tslib                     #设置一个根目录,方便更改
export TSLIB_TSDEVICE=/dev/input/event1             #根据实际情况更改,接入触摸屏后,生成的event设备节点
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf       #tslib的配置文件,一般情况下不需要更改
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts           #插件的目录
export TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal   #校准后生成的校验文件
export TSLIB_CONSOLEDEVICE=none                     #终端控制台不需要
export TSLIB_FBDEVICE=/dev/fb1                      #根据LCD屏幕对应的设备节点设置
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib #添加共享库的目录
export QWS_MOUSE_PROTO=tslib:/dev/input/event1      #QT输入设备的环境变量(不设置此项,校准后光标是准的,鼠标不准)

这个是个特例;在某块板子上,他原来支持的是wayland ,需要改成 Linuxfb的;
请仔细核对 /etc/profile 和 /etc/init.d/S50launcher
在这里插入图片描述
其实,所有的配置文件都要仔细的核对;
2. 常见错误

Failed to mmap framebuffer (Invalid argument)
linuxfb: Failed to initialize screen
no screens available, assuming 24-bit color
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
Cannot create window: no screens available
Aborted

这些错误我都遇到过,还有系统重启 啥的;;网上都能搜到解决方案吧

最后看,还是前文提到的配置问题;

3. 调试

tslib下

qt应用程序

笔记:

我这个板子没有/usr/local/lib把所有的库都丢到
/usr/lib 下了;
qt和tslib的在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
配置文件:
在这里插入图片描述
在这里插入图片描述

然后,后面还添加了make sudo gcc因依赖库移植失败没添加上

在后来,添加大华驱动,
他所依赖的 usb和网络驱动

  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值