QT5用QPA换了QWS之后,USB鼠标就不知道怎么支持,网上搜啊搜,各种尝试,终于可以了。
- export TSLIB_ROOT=/mnt/sdcard/tslib
- export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
- export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
- export TSLIB_TSDEVICE=/dev/event0
- export TSLIB_CALIBFILE=$TSLIB_ROOT/pointercal
- export TSLIB_FBDEVICE=/dev/fb1
- export TSLIB_CONSOLEDEVICE=none
- CUR=`pwd`
- export QTDIR=$CUR/qt5.6.0
- export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins
- export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb1:size=1920x1080:tty=/dev/tty0
- #export QT_QPA_GENERIC_PLUGINS=tslib
- export QT_QPA_GENERIC_PLUGINS=evdevmouse:/dev/event1
- export QT_QPA_FONTDIR=$QTDIR/lib/fonts
- export PATH=$PATH:$CUR:$TSLIB_ROOT/bin
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUR/lib:$QTDIR/lib:$TSLIB_ROOT/lib
- ./MainMenu
触摸屏还没有测试是否可以,但usb鼠标可以了。
从上边也可以看到使用了evdev,所以编译时还得选上。
最终的配置为
- ../configure \
- -release \
- -opensource -confirm-license \
- -no-c++11 -shared \
- -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 \
- -no-mips_dsp -no-mips_dspr2 \
- -I$TSLIB/include -L$TSLIB/lib \
- -no-pkg-config \
- -qt-zlib -no-mtdev \
- -qt-sql-sqlite \
- -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz \
- -no-openssl -no-xinput2 -no-xcb-xlib -no-glib \
- -no-qml-debug \
- -nomake examples -make libs \
- -nomake tools -nomake tests \
- -gui -widgets \
- -optimized-qmake -no-nis -no-cups -no-iconv \
- -tslib -no-icu -no-fontconfig -strip \
- -no-pch -no-dbus \
- -force-asserts \
- -no-xcb -no-kms \
- -linuxfb -no-egl -no-eglfs -no-directfb -no-opengl \
- -mtdev -evdev \
- -xplatform linux-arm-gnueabi-g++ \
- -libinput \
- -no-gstreamer -no-system-proxies \
- -prefix $(pwd)/../../qt5.6.0 -v
其中-mtdev 用于多点触摸,-evdev 用于鼠标键盘