How can I add a list of directories and subdirectories to a QStringList?
This is what I have...
QStringList dirList;
QDirIterator iterateFolders("/Users/userName/targetFolder", QDir::Dirs, QDirIterator::Subdirectories);
while (iterateFolders.hasNext())
{
dirList.append(iterateFolders.next());
}
But I don't think it is working correctly because when I iterate though the list it doesn't show all of the folders, it skips some of them.
for(int i=0; i<dirList.length(); i++)
{
qDebug() <<" Dir At: " << dirList.at(i);
}
What is the correct way to add directories and subdirectories to a QStringList?
Thanks