I've made selection on QFileSystemModel and now I'm trying to get those paths selected by doing:
QList<QModelIndex> r = sel_model_->selectedIndexes();
QStringList result;
for (int i = 0; i < r.size() ; i += 4)//four number of columns
{
//model_ is QFileSystemModel
auto path = model_->filePath(r.at(i));
result.append(model_->filePath(r.at(i)));
}
But the results here does not reflect my choice. If I select let's say drive D, file on drive C and another file in a folder on C, after iteration I'm getting:
result == "D", "D", "someFile on c".
Why is "D" picked for the second time?