当前位置: 代码迷 >> QT开发 >> QT4.7移栽后不能触屏
  详细解决方案

QT4.7移栽后不能触屏

热度:15   发布时间:2016-04-25 03:23:42.0
QT4.7移植后不能触屏
我用的是Qt4.7,板子上系统是Ubuntu11。10,屏幕是电容屏,移植后双击可执行文件没法运行,用命令可以运行,但是触屏不了,一触屏就出现这么一堆
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
而且点屏幕会启动系统里其他程序(点到的地方下面有程序),运行ts_calibrate点了也会启动其他程序,运行ts_harvest 、ts_test也一样,运行ts_print点屏幕没有输出什么,ts_print_raw 点屏幕会输出
276.005677:      0      0      0
276.005679:      0      0      0
276.021823:      0      0      0
请教各位大神怎么解决,我搞了很久了,一直都不行

------解决方案--------------------
帮顶,个人觉得ubuntu系统的话,问题也许是操作系统的触屏驱动。也许这个硬件会有写demo啥的,你找过没有?
------解决方案--------------------
要添加以下的环境变量(根据自己的修改)
#tslib
export TSLIB_TSDEVICE=/dev/event2
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/opt/tq335x/tslib/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/tty1
export TSLIB_FBDEVICE=/dev/fb0


#qt4
export QTDIR=/opt/nrm335x/qt-4.8.5
export QT_PLUGIN_PATH=/opt/tq335x/qt-4.8.5/plugins/
export QWS_MOUSE_PROTO=tslib:/dev/event2

触摸屏不正常可能是 QWS_MOUSE_PROTO 为设置对,另外编译好像有关于触摸的选项,tslib需要交叉编译
  相关解决方案