Hello,

I have a sample code listed below. It works well, but always writes a debug message:
QML QDeclarativeRectangle_QML_0: Binding loop detected for property "parent"

Do anybode have any idea, how could I eliminate this warning?

Qt Code:
  1. import QtQuick 1.0
  2.  
  3. Rectangle {
  4. id: rect1
  5. color: "lightblue"
  6. width: 800
  7. height: 600
  8.  
  9. Item {
  10. width: 600
  11. height: 600
  12.  
  13. Rectangle {
  14. id: test
  15. parent: getRootObject()
  16. anchors.fill: parent
  17. color: "yellow"
  18. opacity: 0.5
  19.  
  20. //! goes to the root object via the item's parent property
  21. function getRootObject() {
  22. var item = test.parent
  23. while (item.parent != undefined) {
  24. item = item.parent
  25. //console.log("w: "+ item.width + " h: " + item.height)
  26. }
  27. return item
  28. }
  29. }
  30. }
  31. }
To copy to clipboard, switch view to plain text mode