Reputation: 67
Let's assume I have a component like this:
Rectangle {
id: rec1
Rectangle {
id: rec
x:10;y:100; height:100;
color: 'red'
anchors {
left: parent.left
right: parent.right
}
Loader {
id:loader
width: parent.width
sourceComponent: comp
}
}
Component {
id: comp
Rectangle {
anchors {
left: parent.left
leftMargin: 1 // this line
right: parent.right
}
height:img.height
Image {
id: img
source: '/myimage.png'
width: parent.width
fillMode: Image.PreserveAspectFit
}
}
}
}
the console reports:
QML Image: Binding loop detected for property "width"
But if I change the comp leftMargin to leftMargin: 0
(not 1), everything is ok
Is this a bug or some feature I am missing?
Upvotes: 0
Views: 2671
Reputation: 7173
In my opinion you made a typo:
width:100; height:100;
...
anchors {
left: parent.left
right: parent.right
}
By doing this you:
width
(to 100
).width
). It is contradiction. Try to solve it (for example, by removing right anchoring) and re-run your application.
Upvotes: 2