PDA

View Full Version : Filter all directories including hidden ones



freemind
1st December 2010, 21:14
Hi,

I'm trying to get all directories in a folder, including the hidden ones, but it seems Qt has some sort of bug when applying the filters.


QDir::Filters only_dirs (
QDir::Hidden |
QDir::AllDirs |
QDir::NoDotAndDotDot |
QDir::NoSymLinks
);

The problem is when i add the QDir::Hidden flag, it lists all the hidden files and folders and not only the folders, like i wish.

Does anybody know any workaround?
Thanks in advance.

wssddc
4th December 2010, 01:17
Two bug reports related to this problem:
http://bugreports.qt.nokia.com/browse/QTBUG-12965
http://bugreports.qt.nokia.com/browse/QTBUG-12584
The only fix I know is to use isFile() to check whether each result is a file or not.