title: QML: How to custom a component and use it in same file
body: <p>Is there some syntax in QML to define and use a component in same file like this?</p>
  
  <pre><code>import QtQuick 2.6
  import QtQuick.Window 2.2
  
  var MyButton = Rectangle { width : 100; height : 60; color : "red" } // define it
  
  Window {
      visible: true
      MyButton // use it
  }
  </code></pre>