Comment puis-je créer une nouvelle fenêtre à partir de QML?

Est-il un moyen de créer une fenêtre entièrement nouvelle instance, comme un enfant de la fenêtre principale QML fenêtre dans un QmlApplication?

//ChildWindow.qml
Rectangle {
    id: childWindow
    width: 100
    height: 100
    //stuff
}

//main.qml
Rectangle {
    id: window
    width: 1000
    height: 600

    MouseArea {
        anchors.fill: parent
        onClicked: createAWindow(childWindow);
    }
}

Je suis en train d'essayer d'éviter d'écrire un Q_OBJECT classe juste pour instanciating la nouvelle fenêtre dans une nouvelle QmlApplicationViewer.

source d'informationauteur opatut | 2011-11-30