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?
import QtQuick 1.0
Rectangle {
id: rect1
color: "lightblue"
width: 800
height: 600
Item {
width: 600
height: 600
Rectangle {
id: test
parent: getRootObject()
anchors.fill: parent
color: "yellow"
opacity: 0.5
//! goes to the root object via the item's parent property
function getRootObject() {
var item = test.parent
while (item.parent != undefined) {
item = item.parent
//console.log("w: "+ item.width + " h: " + item.height)
}
return item
}
}
}
}
import QtQuick 1.0
Rectangle {
id: rect1
color: "lightblue"
width: 800
height: 600
Item {
width: 600
height: 600
Rectangle {
id: test
parent: getRootObject()
anchors.fill: parent
color: "yellow"
opacity: 0.5
//! goes to the root object via the item's parent property
function getRootObject() {
var item = test.parent
while (item.parent != undefined) {
item = item.parent
//console.log("w: "+ item.width + " h: " + item.height)
}
return item
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks