title: Dynamic creation of a button in QML
body: <p>With qt 5.2, I'm trying to add dynamically a simple button like this :</p>
  
  <pre><code>ApplicationWindow
  {
      id: appWindow
  
      width: 640
      height: 420
      minimumHeight: 400
      minimumWidth: 600
  
      function addButton() {
  
          var obj = Qt.createComponent("Button.qml");
  
          if (obj.status == obj.Ready)
          {
              var button = obj.createObject(appWindow);
              button.color = "red";
              button.width=50;
              button.height=80;
              button.x=50; button.y=50;
             }
       }
  
  
      Button {
          anchors.centerIn: parent;
          text: "ok";
  
          onClicked: {
              addButton();
          }
      } ...
  </code></pre>
  
  <p>But just after the createComponent I always get :</p>
  
  <blockquote>
    <p>QQmlComponent: Component is not ready</p>
  </blockquote>
  
  <p>What's wrong ?</p>