Nominate our 2022 Qt Champions!

Settings working (restoring) on Mac+Linux, but not Windows

  • I am trying to use the Settings feature to save user preferences.

    Basically, I have:
    Settings {
    id: userPreferences
    property string startUpPath: ""

    And to make sure I sync the variable on quit, I use Component.onDestruction
    Component.onDestruction: {
    userPreferences.startUpPath= Global.lastUserPath;

    Everything has worked so far on Mac and Linux, but I just started testing Windows and I noticed that my variable is always empty every time I launch my program. I put a console.log in my onDestruction: so I see that I'm setting the variable on quit.

    Can anybody recommend how to fix this or debug this? I'm very new to Qt and I really have no ideas on how to debug this.

  • I figured it out. I didn't specify the following in my main.cpp:

    app.setOrganizationName("Some Company");
    app.setApplicationName("Amazing Application");

    Strange that OS X or Linux didn't need these, but makes sense why I need this.

  • Lifetime Qt Champion


    Which version of Qt are you using ?

  • I'm using 5.4.1

  • Lifetime Qt Champion

    Then you should take a look at the bug report system Windows behaving differently looks like a bug

Log in to reply