title: get child from parent in Qtreeview
body: <p>I am developing a Qt application using QTreeView and QFileSystemModel.
  I am able to get the parent's child till one level but I am not able to get the parent's child's child.
  For eg:</p>
  
  <p>C is child of B,</p>
  
  <p>B is child of A</p>
  
  <p>I am able to get B as A's child but I also want C as A's Child.
  I want like this C->B->A.</p>
  
  <p>Can someone give some input regarding this and help me out.
  Thanks in advance.</p>
  
  <pre><code>//QItemSelectionModel *sel = ui-&gt;dir_tree-&gt;selectionModel();
  QStringList strings = extractStringsFromModel(ui-&gt;dir_tree-&gt;model(), ui-&gt;dir_tree-&gt;rootIndex());
  
  QFileSystemModel* model = (QFileSystemModel*)ui-&gt;dir_tree-&gt;model();
  QModelIndexList indexlist = ui-&gt;dir_tree-&gt;selectionModel()-&gt;selectedIndexes();
  QVariant data;
  
  //QList&lt;QModelIndex&gt; modelindex(indexlist);
  
  int row = -1;
  
  for(int i=0; i&lt;indexlist.size();i=i+4)
  {
      QModelIndex mi=indexlist.at(i);
      info1 = model-&gt;fileInfo(mi);
      QString childstr = info1.filePath();
      QString childname = info1.fileName();
  
      QModelIndex mi2= indexlist.at(i).parent();
      info = model-&gt;fileInfo(mi2);
      QString parentstr = info.filePath();
      QString parentname = info.fileName();
      QStringList childlist;
      for(int j=0;j&lt;model-&gt;rowCount(indexlist.at(i));j++)
      {
          QModelIndex mi3 = indexlist.at(i).child(j, 0);
          info2 = model-&gt;fileInfo(mi3);
          QString childrenstr = info2.filePath();
          childlist &lt;&lt; childrenstr;
          qDebug()&lt;&lt;"parents' children"&lt;&lt;childrenstr&lt;&lt;j;
      }
  }
  </code></pre>