How can i filter out Folders? I looked for QDir::Filters here: but i cannot see how to filter by expression. I Want to Hide Folders Starting with "A00*"
I tried to use nameFilters, but then the folders are just becoming grey:
QStringList filters;
filters <<"Cloth";
dirModel->setNameFilters(filters);
There is a QFileSystemModel's property that defines how items (files, directories) should be visualized is they do not pass the name filter. It is
nameFilterDisables
. By default this property is true, i.e. items that do not pass the name filter are disabled. For your case you have to disable this property to make non filtered items hidden: