嵌入式linux软件平台--QtLib、QwtLib实现图形显示(二)

来源:互联网 发布:windows fix it 下载 编辑:程序博客网 时间:2024/06/06 16:33
嵌入式软件平台使用Qt实现对图形界面的显示支持,使用Qwt实现对图形统计和曲线的支持,使用tslib实现对触摸屏管理的支持。
qtlib,qwtlib,tslib编译完成后,使用arm-linux-gnueabihf-strip对要使用的库进行精简,并复制到rootfs对应的lib,bin目录。

软件平台需要进行相关的配置,支持qt图形程序的执行。

tslib
tslib在使用过程中需要使用对应的配置文件ts.conf,通过环境变量TSLIB_CONFFILE来制定ts.conf的路径,配置如下:
export TSLIB_CONFFILE=/usr/config/ts.conf


ts.conf文件中,对tslib进行配置,内容如下:

# Uncomment if you wish to use the linux input layer event interfacemodule_raw input# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d#module_raw collie# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860# module_raw corgi# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface# module_raw ucb1x00# Uncomment if you're using an HP iPaq h3600 or similar# module_raw h3600# Uncomment if you're using a Hitachi Webpad# module_raw mk712# Uncomment if you're using an IBM Arctic II# module_raw arctic2module pthres pmin=1module variance delta=30module dejitter delta=100module linear
tslib需要的其他环境变量信息如下:

#指定tslib使用的input设备export TSLIB_TSDEVICE=/dev/input/event0#指定tslib的动态库存储路径export TSLIB_PLUGINDIR=/usr/lib/ts#指定tslib使用的fb设备export TSLIB_FBDEVICE=/dev/fb0
tslib在使用前需要对触摸屏进行标定,使用tslib编译生成的ts_calibrate程序实现
ts_calibrate程序执行生成标定文件pointercal,存储路径通过环境变量TSLIB_CALIBFILE指定,配置如下:

export TSLIB_CALIBFILE=/config/pointercal
qtlib
如果使用tslib支持在qt应用中使用触摸屏输入,需要配置环境变量QWS_MOUSE_PROTO,配置如下:

export QWS_MOUSE_PROTO=tslib:/dev/input/event0
如果在qt应用中使用中文显示,需要配置环境变量QT_QWS_FONTDIR指定中文字库路径,配置如下:

export QT_QWS_FONTDIR=/usr/lib/fonts
在qt中支持中文显示,需要下载开源的文泉驿字库。关于文泉驿字库的参考资料查看官网的相关代码。
在嵌入式平台使用中,需要使用转化为*.qpf的字库文件,该文件可以使用工具转换生成,或者直接搜索下载转换好的字库格式。





0 0