QML. Repeater. How to know the Index of each item of the Repeater?

A certain number of buttons is created using a Repeater(ListModel). How to appeal to certain buttons and learn its parameters(X, Y)?
main.qml
Repeater {
 model: buttons

buttons{

}

 ListModel { // model for the buttons 
 id: buttons
 ListElement { model_button_text: "1"; }
 ListElement { model_button_text: "2"; }

buttons.qml
Button{
id: btn
Layout.preferredWidth: Screen.pixelDensity * 18
Layout.preferredHeight: Screen.pixelDensity * 21
Text{
 anchors.centerIn: parent
text:model_button_text
 font.pixelSize: Screen.pixelDensity * 5
 color: "#056699"
 font.bold: true
}

background: Rectangle{
color:"black"
 //radius: 2
 border.width: 2
 border.color: "#056699"
}}

I need when clicking on another button to go to a certain button(created by a Repeater) and get its X and Y(coordinates).
June 5th 19 at 21:21
1 answer
June 5th 19 at 21:23
So, for example
SomeRoot {
 id: root

 Repeater {
 model: buttons
 delegate: SomeDelegate {}
}

Component.onCompleted: {
 [].slice.call(root.children, 0, root.children.length - 1).forEach(function (item) { console.warn(item.x) }); 
}

Or this:
Repeater {
 id: repeater

 model: buttons
 delegate: SomeDelegate {}

 Component.onCompleted: {
 for (var i = 0; i < repeater.count; ++i)
console.warn(repeater.itemAt(i).x);
}
}

Find more questions by tags QMLQt