title: How to Get Absolute Path of Currently Selected Item in QTreeView
body: <p>I have a simple QTreeView with a QFileSystemModel pointing to the root directory: </p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QApplication&gt;
  #include &lt;QFileSystemModel&gt;
  #include &lt;QtGui/QApplication&gt;
  #include &lt;QtGui&gt;
  #include &lt;QTreeView&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      QFileSystemModel *model = new QFileSystemModel;
      QString dir("/");
      model-&gt;setRootPath(dir);
      QTreeView *tree = new QTreeView();
      tree-&gt;setModel(model);
      tree-&gt;setRootIndex(model-&gt;index((dir)));
      tree-&gt;show();
      return a.exec();
  }
  </code></pre>
  
  <p>It displays something like this:
  <img src="https://i.stack.imgur.com/zhnKd.png" alt="enter image description here"></p>
  
  <p>The item I have selected above is <code>/usr/lib/clang</code>. How can I get the absolute path of the currently selected item?</p>