Good evening,
I am developing an application where I have to process a bunch of image files.
To load the file's list, the user have to press a load button and a QFileDialog is created, then I populate a QStringList model with the file's paths.
To show the list I use a QListView
Here the code:

Qt Code:
  1. QFileDialog fileDialog;
  2. fileDialog.setWindowTitle(tr("Open Directory"));
  3. fileDialog.setFileMode(QFileDialog::DirectoryOnly);
  4.  
  5. if (fileDialog.exec() == QDialog::Accepted)
  6. {
  7. QStringList files = getImageFiles(fileDialog.selectedFiles().first());
  8.  
  9. // Populate the model
  10. m_model->setStringList(files);
  11.  
  12. // and pass it to the view
  13. ui->listView->setModel(m_model);
  14. }
  15.  
  16. QStringList MainWindow::getImageFiles(const QString& path) const
  17. {
  18. QStringList result;
  19. QDir root(path);
  20.  
  21. QStringList dirs = root.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
  22.  
  23. foreach (const QString& dir, dirs)
  24. {
  25. result.append(getImageFiles(root.filePath(dir)));
  26. }
  27.  
  28. QStringList files = root.entryList(QString("*.jpg").split(";"), QDir::Files, QDir::Name);
  29.  
  30. foreach (const QString& file, files)
  31. {
  32. result.append(root.filePath(file));
  33. }
  34.  
  35. return result;
  36. }
To copy to clipboard, switch view to plain text mode 

Now in the view I have a list of full paths, but I would only show the files names instead of full path while keeping the full paths in the model
How can I do it? I would have an help on it.
Thanx in advance