Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt4.4 how to get the user settings path

Tags:

c++

qt

  • linux: $HOME/.config
  • windows: %APPDATA%
  • mac os: $HOME/.config

It can be set using http://qt-project.org/doc/qt-4.8/qsettings.html#setPath, but it seems as I am not able to retrieve it.

http://qt-project.org/doc/qt-4.8/qlibraryinfo.html#location QLibraryInfo::LibrariesPath returns the system wide settings dir, which is not what I want.

Any ideas, or do I have to code it separately for each platform?

€: I want to create a sub directory, and store files into it. (You may punish me if this is a bad idea)

like image 412
Ronny Brendel Avatar asked Mar 31 '09 12:03

Ronny Brendel


1 Answers

This might not answer your question directly: if you want to store per-user persistent data, shouldn't you use QDesktopServices::storageLocation(QDesktopServices::DataLocation) instead?

like image 136
Ariya Hidayat Avatar answered Sep 16 '22 16:09

Ariya Hidayat