Recover id in variable
-
Buttons.qml
Rectangle { width:60 height: 80 MouseArea{ anchors.fill:parent onClicked: { loader.source="nextFile.qml" /* I would like to retrieve here the id (in a variable) of my button which is defined in the main.qml */ }main.qml
Buttons{ id: id1 color:"red" x:150 y:150 } Buttons{ id: id2 color:"blue" x:200 y:200 }I would like to retrieve the id in a variable in onCliked {} but the id is in the main.qml and not in the Buttons.qml
thanks you
-
Buttons.qml
Rectangle { width:60 height: 80 MouseArea{ anchors.fill:parent onClicked: { loader.source="nextFile.qml" /* I would like to retrieve here the id (in a variable) of my button which is defined in the main.qml */ }main.qml
Buttons{ id: id1 color:"red" x:150 y:150 } Buttons{ id: id2 color:"blue" x:200 y:200 }I would like to retrieve the id in a variable in onCliked {} but the id is in the main.qml and not in the Buttons.qml
thanks you