rajesh
14th August 2006, 11:15
Hi!
I have written following code to find all files in given directories, but the following code does not give the list of all files available in sub directory too.
How to get all file names?
And how to filter only specific extension files eg: only .txt file ?
QDir dir(wsPath);
dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); ++i)
{
if(list.at(i).completeSuffix() == "txt" )
{
}
}
Regards
Rajesh
I have written following code to find all files in given directories, but the following code does not give the list of all files available in sub directory too.
How to get all file names?
And how to filter only specific extension files eg: only .txt file ?
QDir dir(wsPath);
dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); ++i)
{
if(list.at(i).completeSuffix() == "txt" )
{
}
}
Regards
Rajesh