0

I understand that QTreeWidget has methods for finding an item, but since I want to use a QFileSystemModel, then I'm limited to QTreeView. However, I'd still like to be able to return all items from a QTreeView and place them into a list.

I had thought that I could go through and grab all indexes from the QTreeView, but I'm not sure how to do that.

Maybe something like:

QList<QModelIndex &> treeList;
foreach(QModelIndex &index, ui->tv_list)
{
     treeList.append(index);
}

but I know this isn't correct. What is a good way to get the items or addresses of items into a list from a QTreeView?

NG_
  • 6,895
  • 7
  • 45
  • 67
Ci3
  • 4,632
  • 10
  • 34
  • 44

0 Answers0