Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.10.0
-
None
-
OS: Windows 10 (64-bit)
Qt version 5.10 (64-bit)
Compiler: Visual Studio 2017 (Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25831)
Gamepad: Logitech Wireless Gamepad F710
Description
QGamepadManager doesn't find connected gamepads on Windows 10, QList of zero length is returned by connectedGamepads(). However connectedGamepadsChanged signal is emitted when gamepad is connected/disconnected. Workaround is to connect to this signal, and then connectedGamepads() works as it should.
QML example configureButtons doesn't show not anything in the field "Connected gamepads", but reacts to all buttons.
QList<int> gamepads = QGamepadManager::instance()->connectedGamepads(); qDebug() << "Found" << gamepads.size(); // With one connected gamepad on Ubuntu 16.04 this yields // > Found 1 // On Windows 10 (Visual C++ 2017) the output is: // > Found 0 // Workaround on Win10, is to use signal connectedGamepadsChanged() to monitor connected gamepads connect(QGamepadManager::instance(), &QGamepadManager::connectedGamepadsChanged, this, [=]() { qDebug() << "Connected"; qDebug() << "Found " << QGamepadManager::instance()->connectedGamepads().size(); }
outputs