title: QSortFilterProxyModel does not return a valid index
body: <p>The following pseudo code will be used for explaining my problem:</p>
  
  <pre><code>QTreeView* treeView = new QTreeView();
  QStandardItemModel* sourceModel = new QStandardItemModel();
  //sourceModel has seven columns and will be filled here with four rows
  QSortFilterProxyModel* sortFilterProxyModel = new QSortFilterProxyModel();
  
  sortFilterProxyModel-&gt;setSourceModel(sourceModel);
  treeView-&gt;setModel( sortFilterProxyModel );
  </code></pre>
  
  <p>Now if I call <code>sortFilterProxyModel-&gt;rowCount()</code> I get the correct value <code>4</code>. If I try to get the index of the first column in the first row from the source model it works:</p>
  
  <pre><code>QModelIndex idxOfFirstItem = sourceModel-&gt;index( 0, 0 );
  </code></pre>
  
  <p>Now since the user is able to sort the view I want to get the index of the first item from the proxy model:</p>
  
  <pre><code>QModelIndex idxOfFirstItem = sortFilterProxyModel-&gt;index( 0, 0 );
  </code></pre>
  
  <p>I always get an invalid index here no matter what the row and column is. What am I doing wrong?</p>
  
  <p><strong>Solution:</strong></p>
  
  <p>Ok guys. I solved the problem. Thanks to all your comments, I realized that the implementation should be right. So I tried a few other things and realized that I had a timing problem. My implementation tried to retrieve data from the model while it was still updating. So the source model of the proxy model was not valid during the update. And therefore I got no valid index. After adding a sleep the implementation worked as I need. So I have to synchronize some events in my program. Thank you for your inspiration :)</p>