If you only have one controller, a more flexible approach would be to take the first value returned by the QGamepadManager rather than hard coding it like that. It's not guaranteed that you will have the same value each time.
-
Unsolved QGamePad disconnect on Ubuntu
Game Development • • jhowland