QSetting value() not correct
Hey guys. I am having a problem with QSetting. The problem is that I am reading from an ini that looks like this:
[Current Server Directory]
current.dir=c:\indir
I am using the following code:
Code:
std::cout << "ServerDir: " << INConfig.value("Current Server Directory/current.dir").toString().toStdString() << std::endl;
Basically, my problem is that it returns: c:ndir
I call this a bug... troll tech may call this a feature. Is there anyway to turn this "feature" off?
;) Thank,
Brandon P.
Re: QSetting value() not correct
As the docs say:
Quote:
Although backslash is a special character in INI files, most Windows applications don't escape backslashes (\) in file paths:
windir = C:\Windows
QSettings always treats backslash as a special character and provides no API for reading or writing such entries.
All you can do is to use "\\", "/" (this should work under windows too) or write your own format handler.