diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_p.h index d9bd9a78e4..5485b73fd7 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_p.h +++ b/src/platformsupport/devicediscovery/qdevicediscovery_p.h @@ -79,7 +79,7 @@ public: }; Q_DECLARE_FLAGS(QDeviceTypes, QDeviceType) - static QDeviceDiscovery *create(QDeviceTypes type, QObject *parent); + static QDeviceDiscovery *create(QDeviceTypes type, QObject *parent = 0); ~QDeviceDiscovery(); QStringList scanConnectedDevices(); diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index bd3601bf06..3f92d60aa2 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -44,6 +44,10 @@ #include "qeglfswindow.h" #include "qeglfshooks.h" +#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) +#include +#endif + QT_BEGIN_NAMESPACE QEglFSScreen::QEglFSScreen(EGLDisplay dpy) @@ -56,7 +60,16 @@ QEglFSScreen::QEglFSScreen(EGLDisplay dpy) qWarning("QEglScreen %p\n", this); #endif - static int hideCursor = qgetenv("QT_QPA_EGLFS_HIDECURSOR").toInt(); + QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR"); + bool hideCursor = false; + if (hideCursorVal.isEmpty()) { +#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) + QScopedPointer dis(QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse)); + hideCursor = dis->scanConnectedDevices().isEmpty(); +#endif + } else { + hideCursor = hideCursorVal.toInt() != 0; + } if (!hideCursor) m_cursor = QEglFSHooks::hooks()->createCursor(this); }