Search code examples
qtqmlregistrysettings

Reset application settings to a clear/clean state


I use QML Settings in my application. Therefore, while developing and testing, every time I open the app, it remembers the settings.

How can I clear the settings status so that I can simulate the very first launch of the app by a user? Thanks.


Solution

  • You can specify the file that is used to store the Settings by setting the filename property.

    Settings {
        filename: "/path/to/my/settings/file"
    }
    

    Then when you want to clear the Settings, simply delete the file. Everything should start over with default values after that.