<?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[[SOLVED] QML  Qt.createQmlObject how to refer variable]]></title><description><![CDATA[<p dir="auto">Hi all. I have a QML &amp; JavaScript code:<br />
@ Grid {<br />
columns: 4<br />
y: 50<br />
id: grid<br />
spacing: 50<br />
function pokaz() {<br />
for(var j = 0; j &lt; 5; j++) {<br />
Qt.createQmlObject('import com.nokia.meego 1.1; Label {text: wydatek.nazwa(j)}', grid, '');<br />
Qt.createQmlObject('import com.nokia.meego 1.1; Label {text: wydatek.cena(j)}', grid, '');<br />
Qt.createQmlObject('import com.nokia.meego 1.1; Label {text: wydatek.sztuk(j)}', grid, '');<br />
Qt.createQmlObject('import com.nokia.meego 1.1; Label {text: wydatek.data(j)}', grid, '');<br />
}<br />
}<br />
Component.onCompleted: pokaz();<br />
}@<br />
I can't to refer 'j' value. I have a log:<br />
@ &lt;Unknown File&gt;:1: ReferenceError: Can't find variable: j@<br />
Question is: How can I refer the 'j' value? How I do wrong?</p>
]]></description><link>https://forum.qt.io/topic/27031/solved-qml-qt-createqmlobject-how-to-refer-variable</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 17:00:55 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/27031.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 May 2013 11:42:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] QML  Qt.createQmlObject how to refer variable on Fri, 10 May 2013 19:21:05 GMT]]></title><description><![CDATA[<p dir="auto">Thanks:)</p>
]]></description><link>https://forum.qt.io/post/178802</link><guid isPermaLink="true">https://forum.qt.io/post/178802</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 10 May 2013 19:21:05 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QML  Qt.createQmlObject how to refer variable on Wed, 08 May 2013 11:58:41 GMT]]></title><description><![CDATA[<p dir="auto">@<br />
'import com.nokia.meego 1.1; Label {text: wydatek.nazwa(' + j + ')}'<br />
@</p>
]]></description><link>https://forum.qt.io/post/178533</link><guid isPermaLink="true">https://forum.qt.io/post/178533</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Wed, 08 May 2013 11:58:41 GMT</pubDate></item></channel></rss>