Hey, im trying to get the selected items of a treeview using the qitemselectionmodel... the treeview has the file listing already (using qfilesystemmodel) but when i use my code i get 4 entries back (for each entry clicked) i understand that each item returned has 4 of its own items like name, size etc...

so basically if one item is selected a 1x4 entry should be added in the list but instead i get 4x4... and this carries on for each additional selected item... 8x4 etc...

Qt Code:
  1. QItemSelectionModel *selectionModel = ui->tree->selectionModel();
  2. QModelIndexList indexes = selectionModel->selectedIndexes();
  3.  
  4. list = new QList<QFileInfo>;
  5.  
  6. foreach(index, indexes) {
  7. *list << model->fileInfo(index);
  8. }
To copy to clipboard, switch view to plain text mode 

where am i going wrong?? ?(
any help would be appreciated!

Thanks, Paul.