How can I prevent folders from being show in a QFileSystemModel ?
How can I prevent folders from being show in a QFileSystemModel ?
you should probably change the filters with QFileSystemModel::setFilter
You mean QFileSystemModel::setNameFilters. "Sets the name filters to apply against the existing files." Not what I need, I want to prevent folders from being displayed.
No, he doesn't, He meant QFileSystemModel::setFilter(). Have a look at the possibilities QDir::Filter gives you.
Yeah, my bad. I wrote that because I searched the QtCreator docs for setfilter instead of setFilter, couldn't imagine it would make a difference. Where is Google Search when we need it...No, he doesn't, He meant QFileSystemModel::setFilter(). Have a look at the possibilities QDir::Filter gives you.
But thanks, it solved my problem.
But with the QDir::Filters u can only specify global filters, not specific ones.
If i wanna prevent a folder with name Movies to appear in the FileSystemModel.
How can i do ti ?
thanks
Bookmarks