I have problem in binding item in QML, for example:
Rectangle{
id: thetarget
width:100
height:100
}
Item{
id: container
MouseArea{
id:mousearea
drag.target: thetarget //not work
anchors.fill: thetarget //not work
property int foo: thetarget.width //work
}
}
What I want is to make the bindings for drag.target, anchors.fill work without changing the structure (mousearea is not the sibling or child of thetarget). I have used Binding, function to return thetarget, but they are all useless. Could someone tell me what's wrong?