title: QML Dialog with focused textField
body: <p>I am working on Qt quick application and I wanna open dialog. In this dialog window is <code>TextField</code> and I want to set focus to this <code>textField</code> after <code>dialog</code> is open.
  This code doesn't work.</p>
  <pre><code>function newFolder() {
      newFolderDialog.visible = true
      newFolderDialog.open()
  }
  
  Dialog {
      id: newFolderDialog
      title: &quot;New folder&quot;
      height: 150
      width: 300
      standardButtons: StandardButton.Ok | StandardButton.Cancel
  
      Column {
          anchors.fill: parent
          Text {
              text: &quot;Name&quot;
              height: 40
          }
          TextField {
              id: newFolderInput
              width: parent.width * 0.75
              focus: true
              onFocusChanged: console.log(&quot;Focus changed &quot; + focus)
          }
      }
  
      onVisibilityChanged: {
          if(visible === true){
              newFolderInput.text = &quot;&quot;
              newFolderInput.focus = true
          }
  
      }
  }
  </code></pre>
  <p>output to console is:</p>
  <blockquote>
  <p>qml: Focus changed false<br />
  qml: Focus changed true<br />
  qml: Focus changed false</p>
  </blockquote>
  <p>It look like, that somehow focus is changed after I set focus to <code>textField</code></p>