Why does this work: (works = each delegate text appears below the previous one)
Column {
Repeater {
model: ['test1', 'test2', 'test3']
delegate: Text {
text: modelData
}
}
}
But this breaks the layout, as in each text appears on top of each other:
Column {
Repeater {
model: ['test1', 'test2', 'test3']
delegate: Item {
Text {
text: modelData
}
}
}
}
The same thing happens if I create a separate component:
MyTextItem.qml
import QtQuick 2.5
Item {
property string myText: ''
Text {
text: myText
}
}
And then:
Column {
Repeater {
model: ['test1', 'test2', 'test3']
delegate: MyTextItem {
myText: modelData
}
}
}