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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 1.1.2
    • Fix Version/s: None
    • Component/s: Location
    • Labels:
      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes