Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt App Preferences Being Restored From A Cached Copy? (QSettings)
Forum Updated to NodeBB v4.3 + New Features

Qt App Preferences Being Restored From A Cached Copy? (QSettings)

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 276 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    steveDM
    wrote 16 days ago last edited by steveDM 6 May 2025, 14:51
    #1

    I've searched and prodded the black-box that is user Preferences while trying to debug my app's QSettings, and even if I delete them (in this case on my Mac, in /Library/Preferences), they reappear! Note this is true if I run a previous version of the same Qt App before these new Preferences existed!

    To be clear:
    Version X contains (only) an int to restore a value in a pulldown to that index.
    Version X+1 adds a new preference, a QString, that's a UUID to identify this pulldown entry instead.
    > Debugging version X+1 added this string to my preferences file.

    If I restore my preferences file to version X, or even DELETE them, runing version X (withOUT the QString) restores the QString to preferences.plist! This is true if version X is a Debug or Release build.

    My gut says probably the Mac, or my Qt environment is caching this somewhere. I found a post that mentioned the .config folder, and there's nothing that seems relevant in there.

    Can someone demystify me, please?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote 16 days ago last edited by
      #2

      Hi,

      From very old memories, it's macOS that has that cache. It might be in ~/Library/Caches but that part I can't currently remember.

      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
      • S Offline
        S Offline
        steveDM
        wrote 15 days ago last edited by
        #3

        Hi SG (me, too) -- thanks! There is a qmlcache folder in there containing lots of binary (xml/plist(?)) files which seem to be qml state related (searching some links), and I don't think they have anything to do with the reappearing plist. It's a little more knowledge into the qml performance world.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steveDM
          wrote 15 days ago last edited by
          #4

          One more observation -- I put a quick look in QSettings.fileName(), and it's the usual preferences plist which is NOT on disk!?! (verified in terminal, not just finder).

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote 15 days ago last edited by
            #5

            I think its the defaults command we were looking for !

            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
            • S Offline
              S Offline
              steveDM
              wrote 5 days ago last edited by steveDM
              #6

              Hi -- thank you for the thought, sorry about the delay. I'm honestly not sure how that relates? I've tried to use defaults to see if I can find cached versions of the Preferences, but I haven't seen anything other than the usual -- for the user of an app, their preferences for that app are stored in ~/Library/Preferences/<AppID>.plist, and there are cached "binaries" in ~/Library/Caches/<Company>/<AppName>/qmlcache (qmlc files, which according to some docs suggests its for live state?).

              As the preferences I'm restoring are from [Q]Settings in a QML file, do you think they could be coming from a qmlc[ache] from a previous run? Asked another way, would QML look there in the absence of an OS-supplied preferences (which would have to behave similarly in e.g. Windows/Registry editing). FWIW there are a very large number of qmlc files in ~/Library/.../qmlcache.

              Cheers!

              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