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. Standard path for common application data
Forum Updated to NodeBB v4.3 + New Features

Standard path for common application data

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 3.5k Views 2 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.
  • L_RaizL Offline
    L_RaizL Offline
    L_Raiz
    wrote on last edited by
    #1

    Does Qt provide a way to find the location for common application data?
    QStandardPaths enum includes AppConfigLocation. However, the return value on my Windows 10 machine is C:/Users/<UserName>/AppData/Local/<Organization>/Application/. This is a user-specific location. How do I write my application so it can share data files between users? BTW, I use Qt 5.6

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

      Hi,

      Yes it does: QStandardPaths

      Sorry, misread your question. What kind of file do you intend to share between users ?

      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
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Might be the C:\Users\Public folder that you want to use ?

        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
        • L_RaizL Offline
          L_RaizL Offline
          L_Raiz
          wrote on last edited by
          #4

          It is a data file we make at "the factory". It controls the application behavior. Essentially "the factory" wants to configure an application for all users. When a new version is shipped and installed such configuration file may change. On Windows 7-10 such files are typically prescribed to be placed in C:\ProgramData.

          C;\Users\Public is not really appealing because we would rather keep configuration files not readily exposed to end users. Nonetheless, I will look into this option.

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

            Should that file be changed by other means ?

            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
            • M Offline
              M Offline
              mchinand
              wrote on last edited by
              #6

              Can you use QSettings for this data? If so, check out the scope settings of QSettings. The Platform specific notes section describes where the data will be stored depending on what format you've chosen.

              L_RaizL 1 Reply Last reply
              0
              • M mchinand

                Can you use QSettings for this data? If so, check out the scope settings of QSettings. The Platform specific notes section describes where the data will be stored depending on what format you've chosen.

                L_RaizL Offline
                L_RaizL Offline
                L_Raiz
                wrote on last edited by
                #7

                @mchinand When the format is set to IniFormat and scope is set to SystemScope QSettings behaviour is exactly what I was looking for. I will be able to use it. Thanks.

                On the other hand, this inquiry discovered two Qt blemishes

                • QStandardPaths does not provide access to the IniFormat/SystemScope directory
                • Platform specific notes of QSettings documentation is outdated. It mentions %COMMON_APPDATA% which no longer exists on Windows 10 (maybe even earlier).
                kshegunovK 1 Reply Last reply
                0
                • L_RaizL L_Raiz

                  @mchinand When the format is set to IniFormat and scope is set to SystemScope QSettings behaviour is exactly what I was looking for. I will be able to use it. Thanks.

                  On the other hand, this inquiry discovered two Qt blemishes

                  • QStandardPaths does not provide access to the IniFormat/SystemScope directory
                  • Platform specific notes of QSettings documentation is outdated. It mentions %COMMON_APPDATA% which no longer exists on Windows 10 (maybe even earlier).
                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by
                  #8

                  @L_Raiz said in Standard path for common application data:

                  Platform specific notes of QSettings documentation is outdated. It mentions %COMMON_APPDATA% which no longer exists on Windows 10 (maybe even earlier).

                  The variable is valid for Windows 7 (probably 8 as well), so there's no fault here.

                  Read and abide by the Qt Code of Conduct

                  L_RaizL 1 Reply Last reply
                  0
                  • kshegunovK kshegunov

                    @L_Raiz said in Standard path for common application data:

                    Platform specific notes of QSettings documentation is outdated. It mentions %COMMON_APPDATA% which no longer exists on Windows 10 (maybe even earlier).

                    The variable is valid for Windows 7 (probably 8 as well), so there's no fault here.

                    L_RaizL Offline
                    L_RaizL Offline
                    L_Raiz
                    wrote on last edited by
                    #9

                    @kshegunov I just tried pointing Windows Explorer to %COMMON_APPDATA% on Windows 7 computer and received an error dialog!(0_1473444370621_Capture.PNG

                    Looks to me like something is wrong with your statement.

                    kshegunovK 1 Reply Last reply
                    0
                    • L_RaizL L_Raiz

                      @kshegunov I just tried pointing Windows Explorer to %COMMON_APPDATA% on Windows 7 computer and received an error dialog!(0_1473444370621_Capture.PNG

                      Looks to me like something is wrong with your statement.

                      kshegunovK Offline
                      kshegunovK Offline
                      kshegunov
                      Moderators
                      wrote on last edited by
                      #10

                      @L_Raiz
                      It is possible, I haven't double-checked as I currently don't have a windows at hand.

                      Read and abide by the 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