I use this code.
QFileSystemModel* fsModel = new QFileSystemModel(this);
fsModel->setFilter(QDir::NoDotAndDotDot | QDir::Dirs );
I can not understand how to exclude some folders.
Subclassing from a standard model is of course possible, but is considered bad style. You'll gain a nice reusable component by implementing a generic filter proxy model. Inherit from QAbstractProxyModel
and implement a filter proxy.