Details
-
Task
-
Resolution: Unresolved
-
P4: Low
-
None
-
None
-
None
Description
When using with statements with a QML id, the current scope is checked before the scope of the object passed to the with statement.
Example:
import QtQuick 2.12 Item { property string s: "Unexpected" Item { property int i: 0 // If this property is removed, the correct value is printed Component.onCompleted: { with(target) {console.log("With access", parent.s, i)}; } } Item { property string s: "Expected" Item { id: target property int i: 42 Component.onCompleted: {console.log("Normal access", parent.s)} } } }