<?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[Qlist of qlist]]></title><description><![CDATA[<p dir="auto">Hi everybody, I created qvariantlist of qvariantlist like this:<br />
@    QVariantList DP;<br />
DP&lt;&lt; 2 &lt;&lt; 2300 &lt;&lt; 400 &lt;&lt; 14.5 &lt;&lt; 17.62 &lt;&lt; 0 &lt;&lt; 0 &lt;&lt; 0 &lt;&lt; 80;</p>
<pre><code>QVariantList DC;
DC&lt;&lt; 3 &lt;&lt; 2700 &lt;&lt; 35 &lt;&lt; 0 &lt;&lt; 21.6 &lt;&lt; 21.6 &lt;&lt; 0 &lt;&lt; 2735 &lt;&lt; 0;

QVariantList dataList;
dataList&lt;&lt; DP &lt;&lt;DC  ;@
</code></pre>
<p dir="auto">but my problem is that, when i return the size of the datalist (<a class="plugin-mentions-user plugin-mentions-a" href="/user/qdebug">@<bdi>qDebug</bdi></a>() &lt;&lt; dataList.size();@), qdebug shows the number 16, but I want to show 2, because i filled it up with two data :(</p>
]]></description><link>https://forum.qt.io/topic/46675/qlist-of-qlist</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 14:51:13 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/46675.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Oct 2014 06:35:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 12:42:10 GMT]]></title><description><![CDATA[<p dir="auto">thanks Chris and Dheerendra. i have done it.</p>
]]></description><link>https://forum.qt.io/post/246297</link><guid isPermaLink="true">https://forum.qt.io/post/246297</guid><dc:creator><![CDATA[beh_zad]]></dc:creator><pubDate>Sun, 05 Oct 2014 12:42:10 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 11:03:54 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Chris. It is typedef as well. Based on this only I suggested him. It depends on the requirement on how to make list of list. I have used it where I wanted list of List only. Based on this only I suggested him to create QList of QVariantList. I don't want QList&lt;Variant&gt;.</p>
]]></description><link>https://forum.qt.io/post/246288</link><guid isPermaLink="true">https://forum.qt.io/post/246288</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Sun, 05 Oct 2014 11:03:54 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 09:53:20 GMT]]></title><description><![CDATA[<p dir="auto">Guys, read the docs.<br />
&lt;&lt; operator for lists appends list elements, not the lists themselves. If you want to create a list of lists you need to explicitly create a variant from the list, eg.</p>
<p dir="auto">@<br />
//this appends DP and DC elements to dataList<br />
//size of dataList is size of DP + size of DC<br />
dataList &lt;&lt; DP &lt;&lt; DC;</p>
<p dir="auto">//this creates new variants of type "list" and puts them into dataList<br />
//size is 2<br />
dataList &lt;&lt; QVariant(DP) &lt;&lt; QVariant(DC);<br />
@</p>
<p dir="auto">Btw. QList&lt;QVariantList&gt; doesn't make sense. QVariantList is a typedef for QList&lt;QVariant&gt; so this gives QList&lt;QList&lt;QVariant&gt;&gt;, and what we want is QList&lt;QVariant&gt; where the inner QVariant holds another QList&lt;QVariant&gt;.</p>
]]></description><link>https://forum.qt.io/post/246286</link><guid isPermaLink="true">https://forum.qt.io/post/246286</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Sun, 05 Oct 2014 09:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 09:48:58 GMT]]></title><description><![CDATA[<p dir="auto">is it possible to pass 2d list from c++ to qml ?<br />
when i used @QVariantList dataList;<br />
dataList&lt;&lt; DP &lt;&lt;DC  ;@ instead of  @QList&lt;QVariantList&gt; dataList;<br />
dataList&lt;&lt;DP&lt;&lt;DC;@ i could to pass it with that codes but in 1d list, for example  myList [0] worked but now it doesn't work</p>
]]></description><link>https://forum.qt.io/post/246282</link><guid isPermaLink="true">https://forum.qt.io/post/246282</guid><dc:creator><![CDATA[beh_zad]]></dc:creator><pubDate>Sun, 05 Oct 2014 09:48:58 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 08:29:04 GMT]]></title><description><![CDATA[<p dir="auto">Did you get a chance to look at QQmlListProperty ? This may help you.</p>
]]></description><link>https://forum.qt.io/post/246275</link><guid isPermaLink="true">https://forum.qt.io/post/246275</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Sun, 05 Oct 2014 08:29:04 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 08:12:43 GMT]]></title><description><![CDATA[<pre><code>i use it: 
</code></pre>
<p dir="auto">@    QQuickView view;</p>
<pre><code>QQmlContext *myList = view.rootContext();
myList-&gt;setContextProperty("myList", QVariant::fromValue(dataList));

view.setSource(QUrl("Main.qml"));

view.show();@
</code></pre>
<p dir="auto">but in qml i can't use it, for example @myList [0][0]@</p>
]]></description><link>https://forum.qt.io/post/246272</link><guid isPermaLink="true">https://forum.qt.io/post/246272</guid><dc:creator><![CDATA[beh_zad]]></dc:creator><pubDate>Sun, 05 Oct 2014 08:12:43 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 08:09:14 GMT]]></title><description><![CDATA[<p dir="auto">thanks, it worked. but if i want to pass it to qml what do i do?</p>
]]></description><link>https://forum.qt.io/post/246271</link><guid isPermaLink="true">https://forum.qt.io/post/246271</guid><dc:creator><![CDATA[beh_zad]]></dc:creator><pubDate>Sun, 05 Oct 2014 08:09:14 GMT</pubDate></item><item><title><![CDATA[Reply to Qlist of qlist on Sun, 05 Oct 2014 07:05:40 GMT]]></title><description><![CDATA[<p dir="auto">In your program third list is not declared properly. I think your idea is to create list of QVariantList. It should be something like the following.  Try following.</p>
<p dir="auto">@ QList&lt;QVariantList&gt; dataList;<br />
dataList&lt;&lt;DP&lt;&lt;DC;<br />
qDebug() &lt;&lt; dataList.size();@</p>
]]></description><link>https://forum.qt.io/post/246268</link><guid isPermaLink="true">https://forum.qt.io/post/246268</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Sun, 05 Oct 2014 07:05:40 GMT</pubDate></item></channel></rss>