The player can use the keyboard to play our game, but it would be nice to also allow playing it using a gamepad. Fortunately, Qt provides the Qt Gamepad add-on that allows us to do this easily. As opposed to Qt Essentials (for example, Qt Widgets), add-ons may be supported on a limited number of platforms. As of Qt 5.9, Qt Gamepad supports Windows, Linux, Android, macOS, iOS, and tvOS (including the tvOS remote).
Adding gamepad support
Working with gamepads in Qt
The starting point of the gamepad API is the QGamepadManager class. The singleton object of this class can be obtained using the QGamepadManager::instance() function. It allows you to request the list of identifiers of the available gamepads using the connectedGamepads...