Hi,
I am writing and reading string and int values using QSettings to an Ini file.
When I try to read the values from a different process later on, the values are read as strings instead of int.
This is the code I am using to write values:
QSettings settings("TestQSettings.ini", QSettings::IniFormat);
settings.setValue("AAA",QString("111"));
settings.setValue("BBB",222);
This is the INI file created
[General]
AAA=111
BBB=222
This is the code I am using to read values:
QVariant qvar = settings.value("AAA");
std::cout << "AAA type " << qvar.type() << std::endl;
qvar = settings.value("BBB");
std::cout << "BBB type " << qvar.type() << std::endl;
If I run this code from the same process
AAA type 10
BBB type 2
If I run this code from a different process:
AAA type 10
BBB type 10
Have this problem with Ubuntu 12 and Qt 4.8.1 64 bit.
Thanks!
Bookmarks