PDA

View Full Version : .INI file



durus90
20th July 2017, 09:47
Hello every1,
I have an config.ini file which contains information about a car, and a path to a route.
it starts like
[route]
inputfile="path"
.
.
.
.

How do I use Qsettings to read that path, so I can access the file from that path.
The file from that path is a CSV file from which I have to read other values which will be
used in formulas for other things.

Any1 who have an idea please tell me, I'm very dummy on Qt I've just started working with it.

Lesiok
20th July 2017, 10:26
QSettings my_ini_file( path_to_ini_file, QSettings::IniFormat );
QString my_file_path = my_ini_file.value("root/inputfile().toString();