Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
1.1.2
-
None
Description
In qml file:
import "script.js" as Scr Rectangle { id: parentRect } Component{ id: coordComponent Coordinate{} } Component{ id: polyLineComponent MapPolyline {} } Component.onCompleted: { Scr.setCoordChild(coordComponent,polyLineComponent,parentRect) }
In js file:
.pragma library function setCoordChild(coordElement,polyLineElement,pRect){ var polyLineObj=polyLineElement.createObject(pRect); console.log("polyline parent :"+polyLineObj.parent); ====> Gives QDeclarativeRectangle_QML_1 a) var coordObj=coordElement.createObject(polyLineObj); console.log("coord obj :"+coordObj.parent); ====> Gives undefined b) var coordObj1=coordElement.createObject(null); coordObj1.parent = polyLineObj; console.log("coord obj :"+coordObj.parent); ====> Gives undefined }