0条评论
QT_QPA_EGLFS_HIDECURSOR
(for eglfs) or
QT_QPA_FB_HIDECURSOR
(for linuxfb) is not set and Qt's libudev-based device discovery reports that at least one mouse is available. When
libudev
support is not present, the mouse cursor always show up unless explicitly disabled via the environment variable.
Hot plugging is supported, but only if Qt was configured with libudev
support (that is, if the libudev development headers are present in the sysroot at configure time). This allows connecting or disconnecting an input device while the application
is running.
QT_QPA_EGLFS_HIDECURSOR
(for eglfs) or
QT_QPA_FB_HIDECURSOR
(for linuxfb)两个环境变量的情况下,鼠标是可以显示的,并且只有在支持libudev情况下QT才能支持热插拔。
1844: libudev)
5251: if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
5252: QMAKE_INCDIR_LIBUDEV=`$PKG_CONFIG --cflags-only-I libudev 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
5253: QMAKE_LIBS_LIBUDEV=`$PKG_CONFIG --libs libudev 2>/dev/null`
5254: QMAKE_CFLAGS_LIBUDEV=`$PKG_CONFIG --cflags libudev 2>/dev/null`
5258: if compileTest unix/libudev "libudev" $QMAKE_CFLAGS_LIBUDEV $QMAKE_LIBS_LIBUDEV; then
5260: QT_CONFIG="$QT_CONFIG libudev"
5262: echo "The libudev functionality test failed!"
说明存在相应的配置,在网上查找相应帮助,有位博主已经尝试过,他的结果是:
需要libudev.h头文件。得移植udev。然后重新配置 使出现libudev enabled,libudev测试通过。
但是拿到开发板上,还是不支持热插拔啊。
我也进行了移植尝试,首先下载udev源码https://www.kernel.org/pub/linux/utils/kernel/hotplug/,我用的qt版本比较高,于是下载比较新的udev-182,解压后配置udev相应的congfigure,然后make,由于中间遇到了各种各样的问题,时间紧迫,时间是个单程票耽误不得,再在网上找资料验证自己的方案可能性有多大。发现一片文章介绍udev/mdev的区别(网址如下:http://www.tuicool.com/articles/Eb6FB3),内容如下qt.qpa.input
logging rule, for example by setting the QT_LOGGING_RULES
environment variable to
qt.qpa.input=true
. This is useful for detecting which device is being used, or to troubleshoot device discovery issues.
qt.qpa.input: evdevkeyboard: Using device discovery
qt.qpa.input: udev device discovery for type QFlags(0x8)
qt.qpa.input: Found matching devices ()
qt.qpa.input: evdevmouse: Using device discovery
qt.qpa.input: udev device discovery for type QFlags(0x1|0x2)
qt.qpa.input: Found matching devices ()
qt.qpa.input: evdevtouch: Using device discovery
qt.qpa.input: udev device discovery for type QFlags(0x2|0x4)
搜索上述相应的信息可定位代码位置。具体的代码分析可以见http://blog.csdn.net/fu851523125/article/details/51192065。