title: Call a class inside a loader using QML
body: <p>Actually I have this code :</p>
  <pre><code> import &quot;class1&quot;
   import &quot;class2&quot;
  
   Item {
    id: myItem
    property variant myVar: 0;
    anchors.fill: parent;
  
    Component { 
      id: compClass1
      class1 { id: class1ID
       anchors.fill: myItem;
      }
    }       
    Component { 
     id: compClass2    
      class2 {
       anchors.fill: myItem;
      }
    } 
    Loader { id: myLoader }      
  
    function update() { 
      switch(myID.myVar) {
        case 0:
          myLoader.sourceComponent = compClass1;
          classID.myFunction();
          break;
  
         case 1:
           myLoader.sourceComponent = compClass2;
           break;
      }
    }
  </code></pre>
  <p>The problem when I want to call a function, I get an error :</p>
  <blockquote>
  <p>TypeError: Result of expression 'class1ID.myFunction' [undefined] is
  not a function.</p>
  </blockquote>
  <p>P.S : the class <code>class1</code> have already a function called <code>myFunction()</code></p>