首页 > 技术知识 > 正文

首先是tslib的编译过程:

tar -zxvf tslib-1.4.tar.gz cd tslib ./autogen.sh ./configure –host=arm-linux ac_cv_func_malloc_0_nonnull=yes –cache-file=arm-linux.cache -prefix=/usr/local/tslib make make install

将编译生成的tslib文件夹,放到nfs中,挂载后放到ARM板上的/usr/local/下

ts.conf的配置为:

module_raw input

module pthres pmin=1

module variance delta=30

module dejitter delta=100

module linear

然后运行ts_calibrate,进行校准。然后运行ts_test进行测试。

/etc/profile的环境设置为:

//下面为tslib的环境配置

export QTDIR=/usr/qt/lib

export TSLIB_ROOT=/usr/local/tslib

export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf

export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts

export TSLIB_FBDEVICE=/dev/fb0

export TSLIB_TSDEVICE=/dev/input/event0

export TSLIB_CALIBFILE=/etc/pointercal

export TSLIB_CONSOLEDEVICE=”one”

//下面是qt的环境配置

export LD_LIBRARY_PATH=/lib:$QTDIR:$TSLIB_ROOT/lib:$LD_LIBRARY_PATH

export QT_QWS_FONTDIR=$QTDIR/fonts/

export QWS_DISPLAY=LinuxFb:/dev/fb0

export QWS_SIZE=800×480

export POINTERCAL_FILE=/etc/pointercal

export QWS_DISPLAY=”LinuxFb:mmWidth80:mmHeight160:0″

export QT_PLUGIN_PATH=$QTDIR/plugins/

export QWS_MOUSE_PROTO=Tslib:/dev/input/event0

export PATH=$QTDIR/bin:$PATH

进入 qt的文件夹:

接下来就是qt的配置编译:

./configure \

-prefix /home/zhang/qt-test/qt4.8.5 \

-opensource \

-confirm-license \

-no-qt3support \

-no-phonon \

-no-phonon-backend \

-no-multimedia \

-no-gtkstyle \

-no-svg \

-no-webkit \

-no-javascript-jit \

-no-script \

-no-scripttools \

-no-declarative \

-no-declarative-debug \

-qt-gfx-linuxfb \

-qt-zlib \

-no-gif \

-qt-libtiff \

-qt-libpng \

-no-libmng \

-qt-libjpeg \

-no-rpath \

-no-pch \

-no-3dnow \

-no-avx \

-no-neon \

-no-openssl \

-no-nis \

-no-cups \

-no-dbus \

-embedded arm \

-xplatform qws/linux-arm-g++ \ // linux-nuc970-g++

-little-endian \

-qt-freetype \

-no-opengl \

-no-glib \

-nomake demos \

-nomake examples \

-qt-mouse-tslib \

-nomake docs

紧接着就是make 和 make install

将qt里面的lib拷入文件系统/usr/qt/下

环境设置如上面设置的一样。

进入/usr/local/tslib/bin下进行屏幕校准以及触摸屏的测试,看看是否正常。

然后编译一个案例,看看qt是否能正常的运行。

错误:ts_confg

可能是/usr/local/tslib/etc/ts_confg的第二行没有去掉注释。

segmatation fault:

可能是配置的问题,也可能是库的问题,所以需要更换错误的配置和库.

其他问题基本没遇到,一般的话,网上会有答案

qt程序运行的时候,若出现闪屏的现象,更改rgb格式为565的格式。

猜你喜欢