JeanC
27th February 2011, 15:16
Hello,
I have difficulty supplying arguments to QSettings::value()
This is in the settings file:
[domains]
1=dyndns
[dyndns]
type=dyndns
Now if I call
qDebug() << ini.value("dyndns/type").toString();
I get "dyndns"
But if I call
ini.beginGroup("domains");
QStringList l = ini.allKeys();
for (int i = 0; i < l.size(); i++)
{
QString Domain = ini.value(l.at(i)).toString(), S = QString("%1/type").arg(Domain), Type = ini.value(S).toString();
qDebug() << Domain << S << Type;
}
I don't get the Type string, it's empty, I get "dyndns" "dyndns/type" ""
Thanks.
I have difficulty supplying arguments to QSettings::value()
This is in the settings file:
[domains]
1=dyndns
[dyndns]
type=dyndns
Now if I call
qDebug() << ini.value("dyndns/type").toString();
I get "dyndns"
But if I call
ini.beginGroup("domains");
QStringList l = ini.allKeys();
for (int i = 0; i < l.size(); i++)
{
QString Domain = ini.value(l.at(i)).toString(), S = QString("%1/type").arg(Domain), Type = ini.value(S).toString();
qDebug() << Domain << S << Type;
}
I don't get the Type string, it's empty, I get "dyndns" "dyndns/type" ""
Thanks.