QDirIterator file filtering issue
Solved
General and Desktop
-
I'm attempting to filter the QDirIterator based upon multiple different file extensions. My extensions are in the form of
*.(somePhrase)*
I save each of these filters into a QStringList called fileFilter. The location of the folder is set when the user selects a folder in a QFileDialog. Without the filters, this routine below works returning every file.
However, this isn't working with the filters set, even though I know there are files with these extensions.
QDirIterator it( folderLocation, fileFilter, QDir::Files, QDirIterator::Subdirectories ); while( it.hasNext() ) { QFile * file = new QFile( it.next() ); //do things }
This does not work. The iterator returns no files even though there are files following at least one of the file filters. What could be causing the issue? I feel as though I'm missing something simple.
-
Hi,
Can you show a concrete sample of file filter you are using ?