Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.3, 6.3.0 Alpha, 6.3, 6.2
-
6.2.2, 6.3
-
None
-
7d911956b9074184898c26c12f1280a98eadfc04 (qt/qtdeclarative/dev) 298ffa496d32eeaf997b65d89a389115edbf0e0e (qt/qtdeclarative/6.2)
Description
import QtQuick Item { objectName: "id" id: a Item { id: b objectName: "b" } Component { id: handle Item { property Item a: Item { objectName: "property" } objectName: a.objectName Component.onCompleted: console.log(objectName, a.objectName, b.objectName) } } Component.onCompleted: handle.createObject() }
Should print "qml: property property b". Instead it crashes. qmlsc fails in two related ways here:
- The ID 'a' is preferred over the property 'a'. It should be the other way around
- When looking up the ID 'a' (or 'b' for that matter), it only looks in the context hierarchy of the inner Component. There, it doesn't find it and crashes.
Attachments
For Gerrit Dashboard: QTBUG-98830 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
384129,7 | QmlCompiler: Disallow access to IDs in other components | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
384130,4 | Adapt to change in ID resolution | dev | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |
384532,3 | QmlCompiler: Disallow access to IDs in other components | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
384597,5 | Adapt to change in ID resolution | 6.2 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |