import QtQuick 2.4
import Ubuntu.Components 1.3
Column {
width: 500
height: 500
Component {
id: listcomp
ListItem {
property alias title: layout.title
height: layout.height + divider.height
ListItemLayout {
id: layout
Icon {
width: units.gu(4.5)
height: width
name: "distributor-logo"
SlotsLayout.position: SlotsLayout.First
}
}
}
}
ListItem{
height: l.height + divider.height
SlotsLayout {
id: l
Button {
text: "Add item"
onClicked: rep.model = rep.model + 1
}
}
}
Repeater {
id: rep
model: 1
delegate: Item {
anchors { left: parent ? parent.left : undefined; right: parent ? parent.right : undefined; }
visible: height > 0
height: loader.height
Loader {
id: loader
asynchronous: true
sourceComponent: listcomp
anchors { left: parent ? parent.left : undefined; right: parent ? parent.right : undefined; }
onLoaded: item.title.text = 'Item %1'.arg(index)
}
}
}
}