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 ?
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" )
{
}
}
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" )
{
}
}
To copy to clipboard, switch view to plain text mode
Regards
Rajesh
Bookmarks