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. Where should I place a user configurable resource file?
Forum Update on Monday, May 27th 2025

Where should I place a user configurable resource file?

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

    I would like to include a config.xml file with my app that will let the user tweak some settings that are read on startup. It needs to be user editable, so I can't put into a compiled qrc file. I'm trying to figure out the correct place to put it in my project directory; it needs to be copied to both my Debug and Release directories and I also need to be able to load it with QFile("config.xml"); (or some similar local path).

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

      Hi,

      You can have a default version in qrc so that if:

      • It's the application first start
      • The user breaks the file

      you can re-use that one.

      As for the location, you can use QStandardPaths::writableLocation with QStandardPaths::AppConfigLocation to get a proper location for that file.

      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
      2

      • Login

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