Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.0.2, 5.1.0
-
None
-
Ubuntu 13.04, 64 bit
Description
An item created using the following function in a stateless JS library does not have access to properties that are available in the context of theParent:
function createObjectFromFile(fileName, theParent) {
var component = Qt.createComponent(fileName);
return component.createObject(theParent);
}
See attachment where an item is created in a JS library file four times in slightly different ways. Cases A, B, C work but case D fails with "MyText.qml:4: ReferenceError: root is not defined"
I could understand a logic where an item created in a stateless library does not have a context, but in this case, the parent of the created item does have access to the properties in the context, and I would expect cases C and D to give the same results.