title: How to add element to Column layout with JavaScript
body: <p>I want to add objects to qml <code>Column</code> layout dynamically, but can't figure out how to do this.</p>
  
  <p>So, for simple example, let's assume that we need to add some new object to column by pressing first rectangle. Two others just for some volume.</p>
  
  <p>Here is some code:</p>
  
  <pre><code>import QtQuick 2.9
  import QtQuick.Window 2.2
  
  ApplicationWindow {
      width: 360
      height: 360
      visible: true
      id: root
  
  
      Item {
          id: itemRef
          width: 310; height: 170
  
          Column {
              id: columnRef
              anchors.horizontalCenter: parent.horizontalCenter
              anchors.verticalCenter: parent.verticalCenter
  
              spacing: 5
  
              Rectangle { color: "lightblue"; radius: 10.0
                          width: 300; height: 50
                          Text { anchors.centerIn: parent
                                 font.pointSize: 24; text: "Press me" }
                          MouseArea{
                              anchors.fill: parent
                              onClicked: {
                                  var component = Qt.createComponent("Sprite.qml");
                                  if (component.status === Component.Ready){
                                      sprite = component.createObject(columnRef);
                                  }
                              }
                          }
              }
              Rectangle { color: "gold"; radius: 10.0
                          width: 300; height: 50
                          Text { anchors.centerIn: parent
                                 font.pointSize: 24; text: "1" } }
              Rectangle { color: "lightgreen"; radius: 10.0
                          width: 300; height: 50
                          Text { anchors.centerIn: parent
                                 font.pointSize: 24; text: "2" } }
          }
      }
  }
  </code></pre>
  
  <p>And Sprite.qml is just:</p>
  
  <pre><code>import QtQuick 2.9
  
  Item {
      Rectangle { width: 300; height: 50; color: "red" }
  }
  </code></pre>
  
  <p>I don't want to make it using <code>listmodel</code> and <code>listview</code>. Is there just simple way  to create item from qml file and then add it to column?</p>