title: How to dynamically create objects with variables?
body: <p>I'm having trouble trying to generate objects in QML using Javascript to create them dynamically.</p>
  
  <p>The code I am trying to use is this</p>
  
  <pre><code>Grid {
      id: numbers
      anchors.centerIn: parent
      columns: 3
      spacing: 2
      function createNumbers(){
          var component = Qt.createComponent("Button.qml");
          for(var i=1; i&lt;37; i++){
              component.createObject(numbers)
          }
      }
      Component.onCompleted: createNumbers()
  }
  </code></pre>
  
  <p>Which works fine, however I want to include variables to make them each different, so that when I pass the information to Button.qml it sets the following</p>
  
  <pre><code>property string text: "1"
  property string id: "button1"
  </code></pre>
  
  <p>I can't figure it out, any help would be great, thanks guys.</p>