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. QSettings persist default values
QtWS25 Last Chance

QSettings persist default values

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 845 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.
  • W Offline
    W Offline
    wrosecrans
    wrote on last edited by
    #1

    If I have a Qsettings instance, and I call settings.value("pos", QPoint(200, 200)), is there any way to get QSettings to persist that default value into the ini file (or whatever) storage? I'll have a fairly technically capable userbase for my current project, so I'd ideally like the settings they can tinker with outside of the UI to be fairly obvious if they go poking around in regedit or open the ini file in a text editor. It's not a showstopper - I can always just write documentation. But, who reads the documentation? And it'd be nice if the example config was just automatically in sync with the app. I'd have to update documentation by hand, and having it officially documented would probably be more encouragement of tinkering than I actually want to provide.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You can remove the INI file, then start your application and close it. QSettings should then create a new settings file, filled with default values.

      (Z(:^

      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