Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.10
-
None
Description
When referring to parent in AnchorsChanges, it's unwise to suggest the AnchorChange's parent as the place to resolve to.
Consider
import QtQuick
Item {
id: root
Item {
parent: root.parent
id: slidersColumn
anchors.left: parent.right
}
AnchorChanges {
target: slidersColumn
anchors.left: undefined
anchors.horizontalCenter: parent.horizontalCenter
}
}
which yields
Warning: test.qml:15:35: Unqualified access [unqualified]
anchors.horizontalCenter: parent.horizontalCenter
^^^^^^
Info: parent is a member of a parent element.
You can qualify the access with its id to avoid this warning.
anchors.horizontalCenter: root.parent.horizontalCenter
But parent would be resolved in the context of the AnchorChange's target, so the proposed change is wrong