Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Settings working (restoring) on Mac+Linux, but not Windows
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ewmailing
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ewmailing
      wrote on last edited by
      #2

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

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

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

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Which version of Qt are you using ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • E Offline
          E Offline
          ewmailing
          wrote on last edited by
          #4

          I'm using 5.4.1

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved