title: QtQuick 2 Pass function to elements
body: <p>I have a <strong>QML element "Button"</strong> which has a <strong>MouseArea element inside</strong>.
  What I want to do is to <strong>send a function to the item and then pass it to MouseArea</strong>:</p>
  
  <p>Example:</p>
  
  <pre><code>Button{
      id: smth
      ... 
      ...
     onClicked: console.log("Someone Clicked Me!")
  
  }
  </code></pre>
  
  <p>And my element could be something like this: </p>
  
  <pre><code>Rectangle{
      property var onClicked
      ...
      MouseArea{
         onClicked : parent.onClicked
      }
  }
  </code></pre>
  
  <p>I found out that I can pass the function like in native js without parentheses, but I think there is a way to implement it like MouseArea element does.</p>