Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSettings not connecting to .ini file
bluestreak last edited by
I have a .ini file states.ini which I am trying to connect to QSettings. To test it out, in my .ini file I have
In my Qt c++, I have
QSettings settings(QString("folderWithinHome/subfolder/states.ini"), QSettings::IniFormat);
QString someValue = settings.value("myConnection/ip", "none").toString();
qDebug() << someValue;
However, this returns "none." Any ideas as to why it doesn't correctly find the ip address in the .ini file?
ChrisW67 last edited by
You have provided a relative file path to the ini file. My bet is that the current working directory of the running program is not what you think it is.