Important: Please read the Qt Code of Conduct -

QGamepadManager: saving/loading changed button configuration

  • I'm using QGamepadManager to connect the joystick hardware button to a QGamepad::Button. That works so far. But this configuration is lost after closing the application. In the documentation of the QGamepadManager Class is one slot "setSettingsFile(const QString &file)". But there is no information how this process works or how to load the setting file. I checked in the source code the class "QGamepadBackend". There are the methods "QGamepadBackend::readSettings" and "QGamepadBackend::saveSettings".
    Can anyone help me how to use these methods? Everything is private and I cannot access them from my code. I'm really lost here. This is totally new knowledge for me. There is nothing on the internet or in the examples about this and the documentation of QGamepad related classes are slim to non. So far, all I can do in this process is setting the config files name:



  • Moderators

    and this doesn't work? Maybe you just expecting a something different?
    I personally never used it, but i would expect that the configuration is loaded from the file whenever you set it and written to it once you configure a button.

  • No, it doesn't. I would expect something like this:

    -I call setSettingsFile()
    -I call configureButton()
    -file "joystick.conf" is created
    -I close the app
    -I restart the app
    -the reconfigured button should work the same

    But no. The button has to be reconfigured again. And the file cannot be found anywhere.

  • Moderators

    i checked the sources. There are saveSettings()/readSettings() implementations, but they are never called at any place.

    But note that the Qt Gamepad module is still in Technology Preview state in Qt 5.10

Log in to reply