title: Passing data from a qml file to other?
body: <p>I am just starting with Qt Quick and QML.</p>
  
  <p>I wrote a login page which loads a users id after username and password input. After the successful authentication, I need to pass this ID to the new window that is being created.</p>
  
  <p>How can I do that?</p>
  
  <p><strong>login.qml</strong> snippet</p>
  
  <pre><code>BSButton {
          id: btnOK
          anchors.top:senhaInput.bottom
          anchors.left: senhaInput.left
          anchors.topMargin: 10
          width: (senhaInput.width * 0.60) - 5
          text: "Entrar"
          isDefault: true
          onClicked: {
              lblMsgErro.text = ""
              lblMsgErro.visible = false;
              controller.autenticar(); // returns user id to pass to main.qml
          }
      }
  
  QLoginController {
      id: controller
      login: loginInput.text
      senha: senhaInput.text
  
      onAuthenticated: {
          if (success) {
              var component = Qt.createComponent("main.qml");
              var win = component.createObject();
              win.showFullScreen();
              close();
          } else {
              senhaInput.text = "";
              console.log("Falha na autenticação: Usuário e/ou senha inválidos.");
              lblMsgErro.text = "Usuário e/ou senha inválidos.";
              lblMsgErro.visible = true;
              loginInput.focus = true;
          }
      }
  }
  </code></pre>
  
  <p>The database stuff is working, I just don't know how to send the userid to the main.qml</p>
  
  <p>Thank you in advance.</p>