Is there a way to get ProgramData path in QT using QStandardPaths.
Details:
- I want to know how to get
ProgramDatapath by using functions of QStandardPaths class. - I want cross-platform solution, that is why I want to use QStandardPaths. I believe QT provides such a solution but I could not find it.
- People may ask why I want that, or may suggest it is not good to use
ProgramDatapath. First of all, I am planning to copy there user-independent config file of my app. I want all users to be able to reach that file, only for reading. I am going to locate necessary files in setup step. (We can discuss that situation though, if this is not a good way to do it)
What I have tried already:
QStringList locations = QStandardPaths::locateAll(QStandardPaths::DataLocation, QString(), QStandardPaths::LocateDirectory);QStringList locations2 = QStandardPaths::standardLocations(QStandardPaths::DataLocation);I tried to run my QT as admin (to see if problem is due to some privilege issue) and nothing has changed
With the functions from point 1 and 2 I also tried to use QStandardPaths::GenericDataLocation as a standard location type. Actually, I have tried all types in this link which has "ProgramData" in its explanations
At the end, all I get are:
C:/Users/myUser/AppData/{Local|Roaming}
/Data
- empty
QString.
QSettingswithQSettings::SystemScope.