Comment ajouter dynamiquement des composants QML?

Je suis en train de créer un composant à la volée lorsqu'un bouton est enfoncé, puis l'ajouter à la mère. Je ne suis pas sûr de ce que je fais de mal ici,

J'ai cette mise en page simple:

import QtQuick 2.0
import Ubuntu.Components 0.1
import "components"
import "componentCreation.js" as MyScript

/*!
    \brief MainView with a Label and Button elements.
*/

MainView {
    //objectName for functional testing purposes (autopilot-qt5)
    objectName: "mainView"

    //Note! applicationName needs to match the "name" field of the click manifest
    applicationName: "com.ubuntu.developer..SpritePractice"

    /*
     This property enables the application to change orientation
     when the device is rotated. The default is false.
    */
    //automaticOrientation: true

    width: units.gu(100)
    height: units.gu(75)

    Page {
        title: i18n.tr("Simple")

        Column {
            spacing: units.gu(1)
            anchors {
                margins: units.gu(2)
                fill: parent
            }

            Button
            {
                text: i18n.tr("Hello World!!");
                onClicked:
                {
                    var component;
                    var sprite;
                    component = Qt.createComponent("Sprite.qml");
                    sprite = component.createObject(parent, {"x": 100, "y": 100});
                }
            }
        }
    }
}

Voici mon "sprite" que je suis en train d'ajouter:

import QtQuick 2.0

Rectangle { width: 80; height: 50; color: "red" }

Comment puis-je ajouter le composant je suis de la création de l'actuel parent?

Comment résoudre:

J'ai utilisé la réponse ci-dessous et j'ai utilisé la documentation Ubuntu:

OriginalL'auteur John | 2013-10-23