I'm writing a Qt application that needs to save some settings to the user's configuration directory.
I've come up with the following code to get this folder:
#ifdef Q_WS_WIN
path = QDir::homePath() + "/Application Data/Timely";
#else
path = QDir::homePath() + "/.config/Timely";
#endif
This fails on Windows 7 cause Windows 7 uses App Data/Roaming/[YourApp]. How can I get the user's configuration folder in a cross-platform way? I'm I missing something obvious? (this is supposed to be an easy task)
Depends on the settings you want to record, but I would suggest to use QSettings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With