title: Presetting currentIndex in QML TreeView
body: <p>I'm using QML TreeView to list some categorized options for user to select.</p>
  
  <p>Using property TreeView.selection I have assigned SlectionModel to the treeview.
  I have a problem with preselecting the item. Using </p>
  
  <p>treeView.selection.setCurrentIndex(idx,3) </p>
  
  <p>I only set the properties of the selection model(the item gets correctly selected/higlighted), but treeView.currentIndex is still invalid. And when using key up/down, it will jump to the first item.</p>
  
  <p>What am I missing?</p>
  
  <pre><code> ItemSelectionModel {
          id: treeViewSelectionModel
          objectName: "treeViewSelectionModel"
          model: myModel
          onCurrentChanged:{console.log("Selectio - current changed from ",previous, " to ", current)}
  
      }
  
      TreeView {
          focus: true
          id: treeView
          objectName: "treeView"
          headerVisible: false    //to hide the header
  
          TableViewColumn {
              title: "Name"
              role: "name"
          }
          model: myModel
  
          selectionMode: SelectionMode.SingleSelection
          selection: treeViewSelectionModel
  
          Component.onCompleted: {
              var idx = treeView.model.getPreselected();
              console.log("preselected",idx);
            treeView.selection.setCurrentIndex(idx,ItemSelectionModel.Select);
              treeView.selection = treeView.selection
              //These logged current indexes does not match
              console.log("treeView.currentIndex",treeView.currentIndex);
              console.log("treeView.selection.currentIndex",treeView.selection.currentIndex);
  
              updateGuiSize();
              treeView.forceActiveFocus();
          }
  
      }
  </code></pre>