Hi,
You can try something like this:
property list<QtObject> myModel: [
QtObject{text: "A"},
QtObject{text: "B"},
QtObject{text: "C"}
]
Row {
id: xRow
anchors.centerIn: parent
visible: true
spacing: 5
Repeater {
id:xRepeater
model: myModel
Image {
id:xImage
width: 78; height: 70
fillMode: Image.Stretch
source: "imgs/x.png"
smooth: true
Text {
id: xText
anchors {centerIn: parent}
text: modelData.text
font {pixelSize: 36}
color: "black"
}
}//end of image
}//end of repeater block
}//end of of row block
This way, changes in your object properties should cause binding reevaluation. However, I don’t know how this would be mapped into C++. Probably a QList<QObject*> or a QVariantList but you will have to test this to be sure.
↧