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
QtWS25 Last Chance

Standard path for common application data

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 3.4k 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.
  • L Offline
    L Offline
    L_Raiz
    wrote on 9 Sept 2016, 14:18 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Sept 2016, 14:46 last edited by SGaist 9 Sept 2016, 14:47
      #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
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 9 Sept 2016, 14:51 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 Offline
          L Offline
          L_Raiz
          wrote on 9 Sept 2016, 14:58 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
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 9 Sept 2016, 15:04 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 9 Sept 2016, 15:29 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 1 Reply Last reply 9 Sept 2016, 16:29
              0
              • M mchinand
                9 Sept 2016, 15:29

                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 Offline
                L Offline
                L_Raiz
                wrote on 9 Sept 2016, 16:29 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).
                K 1 Reply Last reply 9 Sept 2016, 16:35
                0
                • L L_Raiz
                  9 Sept 2016, 16:29

                  @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).
                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 9 Sept 2016, 16:35 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 1 Reply Last reply 9 Sept 2016, 18:08
                  0
                  • K kshegunov
                    9 Sept 2016, 16:35

                    @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 Offline
                    L Offline
                    L_Raiz
                    wrote on 9 Sept 2016, 18:08 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.

                    K 1 Reply Last reply 9 Sept 2016, 18:40
                    0
                    • L L_Raiz
                      9 Sept 2016, 18:08

                      @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.

                      K Offline
                      K Offline
                      kshegunov
                      Moderators
                      wrote on 9 Sept 2016, 18:40 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

                      8/10

                      9 Sept 2016, 16:35

                      • Login

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