title: Getting the index for a given item in a QTreeView / Model application
body: <p>My Qt desktop app was built on the editabletreemodel sample application.  In the sample application in treemodel.cpp there is a mthod called getItem() which takes a QModelIndex as a parameter and returns a pointer to a TreeItem.</p>
  
  <p>This is what the method looks like:</p>
  
  <pre><code>TreeItem *TreeModel::getItem(const QModelIndex &amp;index) const
  {
      if (index.isValid()) {
          TreeItem *item = static_cast&lt;TreeItem*&gt;(index.internalPointer());
          if (item)
              return item;
      }
      return rootItem;
  }
  </code></pre>
  
  <p>I would like to do the reverse - that is return a QModelIndex for a given TreeItem.</p>
  
  <p>How can I do this?</p>