0

Basically I developed 2 models in Qt Creator. A Treeview and a Listview. I managed to censor out single files from Treeview by setFilter(QDir::NoDotAndDotDot | QDir::Files) so that only folders show up. The content (single files) of the seleceted folder is then shown in my Listview. But i don't know how to only show specific file types from the folder selected, for example I would only like to see image files (.jpg , .png , etc...).

I tried these commands:

filemodel->setNameFilters(QStringList()<<".jpg");

filemodel->setNameFilters(QStringList()<<"*.jpg");

but all files (even jpg) get shadowed out, which means it doesn't recognize the file type. And .txt files for example still show up in the listview of filemodel. Thanks for any suggestions

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

0 Answers0