I am looking to access a function inside a repeater element in qml. Wether i try calling the function directly or connecting signals between rect1 and rect2, it cannot seem to work. What am i missing or is there any other way to do this ?
The code below is a simplified version of what i am working with.
Rectangle {
signal save
id : rect1
onSave : {
rect2.saveState()
}
Repeater {
id: repeat1
model: length
delegate:
Row {
id: row1
Rectangle {
id: rect2
function saveState()
{
rect2.grabToImage(function(result) {result.saveToFile(filepath);});
}
}
}
}
}