Also there are other ways of creating dynamic objects, you can create an component like this:
Component {
id: blockComponent
Block {}
}
in theory that should be the same as
var blockComponent = Qt.createComponent( "Block.qml" );
only as an QML object and not a local variable.
the advantage is you can simply define default values or anything in the Block object, but still create dynamic objects with the ID (you should not use a first capital letter for variable names and IDs):
var block = blockComponent.createObject(parent);
↧