<?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[Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file)]]></title><description><![CDATA[<p dir="auto">All the articles/posts I found show the use of Qt.createComponent() to load a Component from a QML url, and then to instantiate it:<br />
@<br />
component = Qt.createComponent(sourceQml);<br />
myControl = component.createObject(parentElement);<br />
@</p>
<p dir="auto">I want to dynamically create an instance of a "known" QML object that I don't have the path to. In my case it's RadioButton from the Qt-Components library but it can be anything else.</p>
<p dir="auto">What's the syntax for it?</p>
]]></description><link>https://forum.qt.io/topic/10377/dynamic-creation-of-a-standard-qml-object-not-from-my-own-qml-file</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 21:50:41 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/10377.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Oct 2011 09:56:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file) on Sun, 16 Oct 2011 18:31:49 GMT]]></title><description><![CDATA[<p dir="auto">I ended up using a wrapper QML file anyway for other needs, but I will actually need to update it now to another component. So I think I'll try this new method too. Thanks!</p>
]]></description><link>https://forum.qt.io/post/113478</link><guid isPermaLink="true">https://forum.qt.io/post/113478</guid><dc:creator><![CDATA[frankiefrank]]></dc:creator><pubDate>Sun, 16 Oct 2011 18:31:49 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file) on Thu, 13 Oct 2011 23:21:51 GMT]]></title><description><![CDATA[<p dir="auto">Another option I've heard suggested is:</p>
<p dir="auto">@<br />
Component {<br />
id: component<br />
RadioButton {}<br />
}<br />
...<br />
myControl = component.createObject(parentElement);<br />
@</p>
]]></description><link>https://forum.qt.io/post/113215</link><guid isPermaLink="true">https://forum.qt.io/post/113215</guid><dc:creator><![CDATA[mbrasser]]></dc:creator><pubDate>Thu, 13 Oct 2011 23:21:51 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file) on Thu, 13 Oct 2011 11:37:37 GMT]]></title><description><![CDATA[<p dir="auto">That's a cool way of doing it. Thanks!</p>
]]></description><link>https://forum.qt.io/post/113131</link><guid isPermaLink="true">https://forum.qt.io/post/113131</guid><dc:creator><![CDATA[frankiefrank]]></dc:creator><pubDate>Thu, 13 Oct 2011 11:37:37 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file) on Thu, 13 Oct 2011 11:23:45 GMT]]></title><description><![CDATA[<p dir="auto">@<br />
var newObject = Qt.createQmlObject('import QtQuick 1.0; Rectangle {}', parentItem, "dynamicSnippet1");<br />
@</p>
<p dir="auto">This will create a <em>Rectangle</em> item.</p>
]]></description><link>https://forum.qt.io/post/113128</link><guid isPermaLink="true">https://forum.qt.io/post/113128</guid><dc:creator><![CDATA[task_struct]]></dc:creator><pubDate>Thu, 13 Oct 2011 11:23:45 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file) on Thu, 13 Oct 2011 10:46:41 GMT]]></title><description><![CDATA[<p dir="auto">That would help me if I wanted to code the QML itself on the fly.<br />
But I want to use an <em>existing</em> QML object. Like &lt;Image&gt; or &lt;Text&gt;.</p>
]]></description><link>https://forum.qt.io/post/113125</link><guid isPermaLink="true">https://forum.qt.io/post/113125</guid><dc:creator><![CDATA[frankiefrank]]></dc:creator><pubDate>Thu, 13 Oct 2011 10:46:41 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic creation of a &quot;standard&quot; QML object (not from my own .qml file) on Thu, 13 Oct 2011 10:42:28 GMT]]></title><description><![CDATA[<p dir="auto">You can use "createQmlObject()":<a href="http://doc.qt.nokia.com/4.7-snapshot/qml-qt.html#createQmlObject-method" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.nokia.com/4.7-snapshot/qml-qt.html#createQmlObject-method</a></p>
]]></description><link>https://forum.qt.io/post/113124</link><guid isPermaLink="true">https://forum.qt.io/post/113124</guid><dc:creator><![CDATA[task_struct]]></dc:creator><pubDate>Thu, 13 Oct 2011 10:42:28 GMT</pubDate></item></channel></rss>