Hi all,
I have what I think is a very simple problem.. I want to find out an object's 'id' from javascript. Take the following example:
Code:
import QtQuick 2.0 Rectangle { id: test x: 10; y: 10 width: 122; height: 117 color: "red" objectName: "testing" MouseArea { anchors.fill: parent onClicked: { console.log("parent id: " + parent.id); console.log("parent objectName: " + parent.objectName); } } }
The output from above is
Code:
parent id: undefined parent objectName: testing
As a solution to my problem I can use objectName and this will work fine. The question is why can't I use id? I can not see any reason you shouldnt be able to do this, it seems perfectly valid to me.
Kind regards