Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Saving user data: which of QStandardPaths to use?
Qt 6.12 LTS is out! See what's new in the release blog

Saving user data: which of QStandardPaths to use?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.8k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi all,

    I am using Qt to write an image viewer where the user can create notes/annotations about the image and bookmark interesting points of view. I was thinking of saving these notes/bookmarks in QStandardPaths::DataLocation, but it seems like that might be used more for user settings and configurations. Would QStandardPaths::CacheLocation be more appropriate?

    Thank you from a Qt newbie :)

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Also, what is returned by QStandardPaths::writableLocation(QStandardPaths::DataLocation) under Windows 7? I would like to use AppData/Roaming instead of AppData/Local.

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

        Hi and welcome to devnet,

        I would go for DataLocation. If I understand correctly, CacheLocation would be more for something like data created et reused while running your program but cleared at the end. (I might be wrong) And since your "meta data" looks they are going to be kept, it seems to be that it can be associated to persistent data.

        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
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Yes, writableLocation(DataLocation), for apps.

          Roaming isn't available yet, please comment on https://bugreports.qt-project.org/browse/QTBUG-15158.

          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
          • Unsolved