title: how to load child1.qml page on to main.qml page calling from another_child.qml page
body: <p><strong>In my MyHeader.qml cannot load the MyChild2.qml.</strong> How to load child qml page on to mmain.qml page calling from another child qml page as shown below.</p>
  
  <ul>
  <li><p>TestProject Folder</p>
  
  <ul>
  <li><p>qml Folder</p>
  
  <ul>
  <li>Main.qml</li>
  <li><p>MyChild1.qml</p></li>
  <li><p>mainui Folder</p>
  
  <ul>
  <li>MyHeader.qml</li>
  <li>MyChild2.qml</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <hr>
  
  <pre><code>import QtQuick 2.10
  import QtQuick.Controls 2.2
  import "."
  
  // Main.qml
  
  ApplicationWindow {
      id: rootApp
  
      Loader {
          id: loaderPage
          anchors.fill: parent
      }
  
      MyChild1 {
      }
  }
  
  
  // MyChild1.qml
  import QtQuick 2.10
  import QtQuick.Controls 2.2
  import "."
  
  Page {
      id: myItem1
      anchors.fill: parent
  
      MyHeader {
          anchors.top: parent.top
      }
  }
  
  
  // MyChild2.qml
  import QtQuick 2.10
  import QtQuick.Controls 2.2
  import "."
  
  Page {
      id: myItem2
      anchors.fill: parent
  
      Rectangle {
          anchors.fill: parent
          color: "#000000"
      }
  
  }
  
  
  
  // MyHeader.qml
  import QtQuick 2.10
  import QtQuick.Controls 2.2
  import "."
  
      Rectangle {
          id: myHeader
          width: parent.width
          height: dp(30)
          color: "lightblue"
  
          Text {
              id: loadQML
              text: "Load QML"
              color: "#000000"
              font.pixelSize: dp(20)
  
              MouseArea {
                  anchors.fill: parent
                  onClicked: {
                      myItem1.visible = false
                      loaderPage.source = "MyChild2.qml"
                      loaderPage.Top
                  }
              }
          }
  
      }
  </code></pre>
  
  <hr>
  
  <p>Using the Loader and Connection I am getting Cannot assign to non-existent property "onPageChanged"</p>
  
  <pre><code>import QtQuick 2.10
  
  import "mainui"
  
  ApplicationWindow {
      id: rootApp
  
      signal pageChanged(int page);
  
      Loader {
          id:rootLoader
          anchors.fill: parent
          source: "mainui/Page1.qml"
  
          Connections {
              target: rootLoader.item
              onPageChanged: {
                  switch(page)
                  {
                      case 1: rootLoader.source = "mainui/Page1.qml"; break;
                      case 2: rootLoader.source = "mainui/Page2.qml"; break;
                  }
              }
          }
      }
  
  } // APP
  </code></pre>