<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Trouble with .ini settings file]]></title><description><![CDATA[<p dir="auto">I have ab .ini file structured like this:</p>
<p dir="auto">[theme]<br />
background=#000000<br />
text=#87ca00<br />
border=#87ca00<br />
slider=#ffff7f</p>
<p dir="auto">I need to retrieve the value of each key. This is my attempt</p>
<pre><code>    settings = new QSettings(QDir::currentPath() + "/config.ini", QSettings::IniFormat);
    settings-&gt;beginGroup("theme");
    QStringList keys = settings-&gt;childKeys();
    for (int i=0; i &lt; keys.size(); i++) {
        QString value = "theme/";
        value.append(keys.at(i));
        qDebug() &lt;&lt; "key" &lt;&lt; keys.at(i) &lt;&lt; settings-&gt;value(value).toString();
    }
    settings-&gt;endGroup();
</code></pre>
<p dir="auto">The output is</p>
<p dir="auto">key "background" ""<br />
key "border" ""<br />
key "slider" ""<br />
key "text" ""</p>
<p dir="auto">As you can see, the text corresponding to the key value is empty.<br />
Where am I doing wrong?</p>
]]></description><link>https://forum.qt.io/topic/120709/trouble-with-ini-settings-file</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 01:34:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/120709.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Nov 2020 10:35:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Trouble with .ini settings file on Tue, 10 Nov 2020 10:38:57 GMT]]></title><description><![CDATA[<p dir="auto">Very well, thank you!</p>
]]></description><link>https://forum.qt.io/post/626567</link><guid isPermaLink="true">https://forum.qt.io/post/626567</guid><dc:creator><![CDATA[UnitScan]]></dc:creator><pubDate>Tue, 10 Nov 2020 10:38:57 GMT</pubDate></item><item><title><![CDATA[Reply to Trouble with .ini settings file on Tue, 10 Nov 2020 11:59:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/unitscan">@<bdi>UnitScan</bdi></a> said in <a href="/post/626565">Trouble with .ini settings file</a>:</p>
<blockquote>
<p dir="auto">QString value = "theme/";</p>
</blockquote>
<p dir="auto">You already called beginGroup() within this.</p>
]]></description><link>https://forum.qt.io/post/626566</link><guid isPermaLink="true">https://forum.qt.io/post/626566</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 10 Nov 2020 11:59:44 GMT</pubDate></item></channel></rss>