I have a custom QML element that I use in my app.
MyImageView.qml
I can create instances of it in javascript without issue using a ComponentDefinition such as (names and methods vastly simplified for sake of readability):
attachedObjects: [
ComponentDefinition {
id: defMyImageView
MyImageView { }
}
]
function addCustom() {
var obj = defMyImageView.createObject();
obj.customSource = "xyz";
myContainer.add(obj);
}
How can I do the same using c++ while keeping the current MyImageView.qml file?