PDA

View Full Version : Hiding files which don´t fit the filter



Percy
27th April 2010, 15:30
Hi there,

This is a very simple doubt, but I can´t make it work.
I have a treeview and a filter. I want this treeview to show just what the namefilter ("*.exe") is configured to.
When I set the namefilter, all the files become gray (disabled) but the ones which fit the namefilter. I don´t want them to disable, I want them to disappear from the treeview.
This should be very simple, but I can´t find a solution.

Thanks,

Percy.

Kumosan
27th April 2010, 15:42
Your description is so incomplete it borders uselessness. QTreeView has no filters. The models have. Or can have. So I suppose you are talking about QFileSystemModel.
This class has a method: void setNameFilterDisables ( bool enable )

Percy
27th April 2010, 15:51
Thanks, Kumosan!
Worked properly!