<?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[QstringList]]></title><description><![CDATA[<p dir="auto">Hi<br />
I have a question in qt c++.<br />
I want to assign each item of stringlist to another stringlists<br />
like:<br />
stringlist_1 =("k#k1#k2" , "s#s1#s2" , "b#b1#b2")<br />
I want to make them like this :<br />
stringlist_2 = ("k","k","k2")<br />
stringlist_3 = ("s","s1","s2")<br />
etc..</p>
<p dir="auto">how can I make that?<br />
I tray to use this code</p>
<pre><code>for (int i=0 ; i&lt;2 ; i++)
{
    QStringList d = stringlist_1.value(i).split("#");
    qDebug()&lt;&lt; d ; 
 } 
</code></pre>
<p dir="auto">I use for loop becuase my list it is very big, but<br />
the problem , it is storing all strings of primary list in same stringlist (d).<br />
how can I let for loop change the stringlist which assigned to it in each loop?<br />
or there is another method can I make that?<br />
thanks</p>
]]></description><link>https://forum.qt.io/topic/65562/qstringlist</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 06:22:19 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/65562.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Mar 2016 23:39:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QstringList on Wed, 30 Mar 2016 06:00:44 GMT]]></title><description><![CDATA[<p dir="auto">What about storing the stringList in another container like list?</p>
<pre><code>#include QCoreApplication
#include QStringList
#include QDebug

int main(int argc, char *argv[]){
    QStringList a{"k#k1#k2" , "s#s1#s2" , "b#b1#b2"};
    QList&lt;QStringList&gt; list;
    foreach (const QString &amp;s, a) {
    list.append(s.split("#"));
   }
    qDebug() &lt;&lt; list;
}
</code></pre>
]]></description><link>https://forum.qt.io/post/320050</link><guid isPermaLink="true">https://forum.qt.io/post/320050</guid><dc:creator><![CDATA[yeckel]]></dc:creator><pubDate>Wed, 30 Mar 2016 06:00:44 GMT</pubDate></item></channel></rss>