QSettings - .ini - and storing path to files
Hello,
i am using QSettings and IniFormat in a windows-based project.
The idea is to store some basic configuration data as .ini file - which basically works (write to & read from is fine).
Now i am wondering what is the best idea to store entire path to files in an ini.
One issue is the difference between linux path & windows paths - the other issue is the drive-letter.
so the question is:
What is the best way to store paths to files (windows env) in an .ini file - keeping the drive-letter and a working path_structure.
Best regards
el
Re: QSettings - .ini - and storing path to files
Qt on all platforms internally is using / (slash) in paths.
Re: QSettings - .ini - and storing path to files
And there is ToNativeSeperators and friends to convert back and forth, so no need to do it yourself.
Re: QSettings - .ini - and storing path to files
for example:
Code:
lastPath
= appSettings
->value
("myFilePath",
QApplication::applicationDirPath()).
toString();
...
appSettings->setValue
("myFilePath",
QFileInfo(fn
).
absolutePath());
Qt hides platform specific stuff - just try it :)