<?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[QML recursive instantiation.]]></title><description><![CDATA[<p dir="auto">Hi,<br />
REcursive instantiation is not allowed in QML as I see. <a href="https://codereview.qt-project.org/c/qt/qtdeclarative/+/30237" target="_blank" rel="noopener noreferrer nofollow ugc">https://codereview.qt-project.org/c/qt/qtdeclarative/+/30237</a><br />
But how to accomplish this ? :</p>
<pre><code># MyComp.qml
Item {
    Repeater {
       model : [somedata]
       delegate: MyComp{} 
   }
}
</code></pre>
<p dir="auto">There is no risk of infinite recursion since instantiation is controlled by the model.</p>
<p dir="auto">I would need it to build something like a tree.</p>
<p dir="auto">Thanks for help<br />
Jimmy</p>
]]></description><link>https://forum.qt.io/topic/118095/qml-recursive-instantiation</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 20:00:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/118095.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Aug 2020 20:03:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QML recursive instantiation. on Tue, 18 Aug 2020 17:39:19 GMT]]></title><description><![CDATA[<p dir="auto">Long answer:<br />
Build a model in C++ around a tree structure.  Use the TreeView object to display this tree.  Your MyComp.qml can be used as a delegate.</p>
]]></description><link>https://forum.qt.io/post/612984</link><guid isPermaLink="true">https://forum.qt.io/post/612984</guid><dc:creator><![CDATA[fcarney]]></dc:creator><pubDate>Tue, 18 Aug 2020 17:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to QML recursive instantiation. on Mon, 17 Aug 2020 20:39:17 GMT]]></title><description><![CDATA[<p dir="auto">If this were allowed, just one item in your model would cause infinite recursion.</p>
]]></description><link>https://forum.qt.io/post/612824</link><guid isPermaLink="true">https://forum.qt.io/post/612824</guid><dc:creator><![CDATA[fcarney]]></dc:creator><pubDate>Mon, 17 Aug 2020 20:39:17 GMT</pubDate></item></channel></rss>