Using Component should do the trick.
MySignalSource {
Row {
id: myRow
anchors.fill: parent
}
Component {
id: myRectComp
Rectangle {
width: 50
height: 50
}
}
onSignalFired: {
var rect = myRectComp.createObject(myRow)
rect.color = "black"
}
}
Not tested, but it should work like that.
精彩评论