I have found a solution.
I have to create first my object column. Then I can create "children" :
Item {
id:previewInfo
property variant dataCurrentItem: myApp.searchResult.length>0 ? myApp.searchResult[listResult.currentIndex] : ""
Component {
id:simpleComponent
Text{
wrapMode: Text.WordWrap;
font.pixelSize: 21;
}
}
Component {
id: columnComponent
Column {
id:myColumComposed
width:200;
function addText(data){
if(data) {
simpleComponent.createObject(myColumComposed,{"text":data});
}
}
}
}
Column {
id: mainColumn
width: parent.width; height:parent.height
spacing:20
}
onDataCurrentItemChanged: {
for(var i=0; i<mainColumn.children.length; ++i) {
mainColumn.children[i].destroy()
}
if(dataCurrentItem) {
if(dataCurrentItem.data1) {
simpleComponent.createObject(mainColumn,{"text":data1});
}
if(dataCurrentItem.data2) {
simpleComponent.createObject(mainColumn,{"text":data2});
}
var objectColumn = columnComponent.createObject(mainColumn);
objectColumn.addText("data3");
objectColumn.addText("data4");
}
}
}