Change path of saving file QSettings
Unsolved
General and Desktop
-
hi @Kaznachei
when you don't specify a path in the QSettings constructor, than the file will be relative to exe executable.
Therefore
QSettings settings("save.ini", QSettings::IniFormat); == QSettings settings("path/toExecutable/save.ini", QSettings::IniFormat);
Therefore you can use applicationDirPath to get the path to your exe
QSettings settings("save.ini", QSettings::IniFormat); == QSettings settings(QCoreApplication::QCoreApplication::applicationDirPath() + "/save.ini", QSettings::IniFormat);
Now, knowing that. your an save the path in a QString and manipulate it, so that it points to an other folder and than pass that one in the Settings constructor.
-
Hi,
If by that you mean you want to change the path of an existing QSettings object, you can't.