首先,我移植的tslib没有问题,使用的是tslib1.4。在开发版上面运行测试程序都没问题,使用cat event1也能够从控制台看到有数据。而且我使用qt-2.3.10编译的程序,可以在开发板里面支持触屏。qt4.7.4的配置文件如下:
./configure --prefix=/home/hero/work/qt-arm \
-opensource \
-confirm-license \
-embedded arm \
-xplatform qws/linux-arm-g++ \
-platform /qws/linux-x86-g++ \
-little-endian \
-host-little-endian \
-shared \
-no-qt3support \
-no-phonon -no-phonon-backend \
-qt-zlib \
-no-gif \
-no-libtiff \
-qt-libjpeg \
-no-nis \
-no-cups \
-no-webkit \
-no-glib \
-no-dbus \
-no-rpath \
-no-mmx -no-3dnow \
-no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 \
-no-avx -no-neon \
-no-audio-backend \
-no-svg \
-no-javascript-jit \
-no-script \
-no-scripttools \
-no-multimedia \
-no-openssl \
-nomake tools \
-qt-mouse-tslib -I/home/hero/work/tslib/include -L/home/hero/work/tslib/lib
qt-mouse-tslib 后面的路径没有问题,tslib编译安装的就是这个位置。
然后mkspecs/qws/linux-arm-g++/qmake.conf文件如下:
#
# qmake configuration for building with arm-linux-g++
#
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = arm-linux-gcc -lts
QMAKE_CXX = arm-linux-g++ -lts
QMAKE_LINK = arm-linux-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-g++ -lts
# modifications to linux.conf
QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_STRIP = arm-linux-strip
load(qt_config)
使用qmake生成的Makefile文件部分内容如下:
CC = arm-linux-gcc -lts
CXX = arm-linux-g++ -lts
DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I../../../mkspecs/qws/linux-arm-g++ -I. -I../../../include/QtCore -I../../../include/QtNetwork -I../../../include/QtGui -I../../../include -I. -I.
LINK = arm-linux-g++ -lts
LFLAGS = -Wl,-O1
LIBS = $(SUBLIBS) -L/home/hero/work/qt-arm/lib -lQtGui -L/home/hero/work/tslib/lib -L/home/hero/work/qt-arm/lib -lQtNetwork -lQtCore -lpthread
AR = arm-linux-ar cqs
RANLIB =
QMAKE = /home/hero/work/qt-arm/bin/qmakearm
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
SED = sed
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
STRIP = arm-linux-strip
INSTALL_FILE = install -m 644 -p
INSTALL_DIR = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
如何做,才能让qt4.7.4编译出来的程序支持触摸屏呢??
我做了一些测试,把开发板里面的tslib文件夹改名,而缓进个变量里面不做改动,还是之前的样子,然后我分别运行qt.2.3.10编译的程序,和qt4.7.4编译的程序。
发现,2.3.10的程序无法运行,找不到tslib的相应文件。而4.7.4的程序可以正常运行,而且屏幕中间还有个鼠标。
------解决方案--------------------
有没export环境变量啥的?
例如:
export QWS_MOUSE_PROTO="Tslib:/dev/input/touchscreen0"