Priority: P3: Somewhat important
Resolution: Won't Do
Affects Version/s: 5.9.0
Fix Version/s: None
Environment:Qt 5.9.0 on Windows 7, tested both with Xbox 360 controller and an Xbox One controller.
Detecting connected gamepads with QGamepadManager::instance()->connectedGamepads() fails on Windows 7 when no QWindow was shown on screen yet.
A workaround is to create, show, and delete a dummy window before detecting gamepads:
QWindow* window = new QWindow();
Note that both show() and processEvents() are necessary. Presumably some initialization stuff happens on Windows platforms when the first window is shown on screen, and QGamepadManager relies on that.
The problem does not exist on Linux. I did not test other systems.