Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1760

Parent cannot be set for Coordinate element using createObject() method

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 1.1.2
    • Location
    • 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 
      
      }
      

      Attachments

        Activity

          People

            alewilso Alex Wilson (closed Nokia identity) (Inactive)
            siva886 Sivabalan T
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: