title: QML form layout
body: <p>I use QML for UI in my app and now I want to build some form.
  This is a code:</p>
  
  <pre class="lang-js prettyprint-override"><code>Window {
      width: 400
      height: 600
      flags: Qt.Dialog
      modality: Qt.ApplicationModal
  
      GridLayout {
          id: mainLayout
          columns: 2
          rowSpacing: 5
          columnSpacing: 5
          anchors {
              top: parent.top;
              left: parent.left
              right: parent.right
          }
  
          Label { text: "field1" }
          TextField { id: field1; }
  
          Label { text: "field2"}
          TextField { id: field2 }
      }
  }
  </code></pre>
  
  <p>How can I set width for the <code>TextField</code>s? Most of them have to fit all the space in the right column.</p>
  
  <p>That how it looks now:</p>
  
  <p><img src="https://i.stack.imgur.com/WqbTi.png" alt="enter image description here"></p>