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:

Qt Code:
  1. import QtQuick 2.0
  2. Rectangle {
  3. id: test
  4. x: 10; y: 10
  5. width: 122; height: 117
  6. color: "red"
  7. objectName: "testing"
  8.  
  9. MouseArea {
  10. anchors.fill: parent
  11. onClicked:
  12. {
  13. console.log("parent id: " + parent.id);
  14. console.log("parent objectName: " + parent.objectName);
  15. }
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 

The output from above is
Qt Code:
  1. parent id: undefined
  2. parent objectName: testing
To copy to clipboard, switch view to plain text mode 

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