View Single Post
coderus's Avatar
Posts: 6,436 | Thanked: 12,700 times | Joined on Nov 2011 @ Ängelholm, Sweden
#154
Originally Posted by aerique View Post
What's the proper way to store an apps settings?

For my current (and first) app I'm for now just grabbing the `$HOME` environment variable and stuff a file in `$HOME/.config/app/settings`, but this is just for local dev and testing.

Once I'm distributing it through OpenRepos I'd like to do it the proper way (if there is one).
https://doc.qt.io/archives/qt-5.6/qstandardpaths.html

Code:
QStandardPaths::writableLocation(QStandardPaths::DataLocation)
If you use QSettings class it will automatically create file in correct location.
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 4 Users Say Thank You to coderus For This Useful Post: