瑞芯微Rockchip开发者社区
直播中

王伟

7年用户 1493经验值
私信 关注
[问答]

rk3128触摸屏跑上了QT5+还是不能使用该怎么办呢

跑上了QT5+ 但是触摸屏总是不能使用
开始以为是触摸屏驱动不行,直接编译内核,取出驱动测试,发现是好的
又开始看ts库 ,发现里面是有文件 tsconf的 ,但是 还真的没有tslib库
解决tslib
重新编译tslib 1.4 更换到
/usr/locla下 和 /usr/下


配置环境变量
vi /etc/profile
增加
export TSLIB_ROOT=/usr/tslib
export TSLIB_TSDEVICE=/dev/input/event1
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal  
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf   
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_FBDEVICE=/dev/fb0  
export TSLIB_CONSOLEDEVICE=none  
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib
export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_TSEVENTTYPE=H3600
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
#export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CALIBFILE=/mnt/disk/pointercal
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
#export QWS_MOUSE_PROTO=Tslib:/dev/input/event1
#export QWS_MOUSE_PROTO=TPanel:/dev/input/event1
#export QWS_MOUSE_PROTO="Tslib:/dev/input/event1 MouseMan:/dev/input/mice"
#export QWS_MOUSE_PROTO=MouseMan:/dev/input/mice
export QWS_KEYBOARD="TTY:/dev/tty1"
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/plugins/qtopialmigrate/:$QTDIR/qt_plugins/imageformats/:$QTDIR/lib:/root/tslib/build/lib:$LD_LIBRARY_PATH
#exec /usr/local/tslib/bin/ts_calibrate  1>/dev/null 2>/dev/null
export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event1
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal  
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf   
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_FBDEVICE=/dev/fb0  
export TSLIB_CONSOLEDEVICE=none  
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib
这时候启动里面的测试文件,还是缺少库
不是下面这个 就是下面另一个,二选一
export QT_QPA_EGLFS_ALWAYS_SET_MODE=1
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_INTEGRAtiON=eglfs_kms
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CONFFLLE=/etc/ts.conf
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_TSEVENTTYPE=INPUT
export QT_QPA_EGLFS_TSLIB=1
export QT_QPA_EVDEV_MOUSE_PARAMETERS=abs
export QT_QPA_EGLFS_KMS_CONFIG=/usr/share/qt5/cursor.json
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event1,evdevmouse:/dev/input/event1
export QT_QPA_EGLFS_DISABLE_INPUT=1
/usr/tslib
export TSLIB_ROOT=/usr/tslib
export TSLIB_TSDEVICE=/dev/input/event1
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal  
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf   
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_FBDEVICE=/dev/fb0  
export TSLIB_CONSOLEDEVICE=none  
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib
这时候 ts_calibrate 已经可以运行了
解决qt
qt还是不能用
使用下面第二行,eventx 要改为自己的触摸屏触发事件
export QT_LOGGING_RULES=qt.qpa.input=true # 打印触屏信息
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1 # 指定输入设备的名称
export QT_QPA_EVDEV_MOUSE_PARAMETERS=/dev/input/event0 # 将触摸屏的点击事件配置成Qt的鼠标点击事件
export QT_QPA_FB_HIDECURSOR=1 # 为1则隐藏鼠标光标,为0则显示鼠标光标

原作者:鸭鸭打瞌睡

回帖(1)

王健

2022-5-10 11:16:52
举报

更多回帖

发帖
×
20
完善资料,
赚取积分