Прежде всего, вам нужно добавить еще один обратный слеш к вашему SkipThisDir
, чтобы избежать его.
Second you could do a check at the beginning of the while loop and if the current folder is the one you want to skip you could continue to the next directory.
QString SkipThisDir = "C:\\stuff";
QDirIterator CPath(PathToCopyFrom, QDir::AllEntries | QDir::NoSymLinks,
QDirIterator::Subdirectories );
while(CPath.hasNext())
{
QString currentDir = CPath.next();
if (currentDir == SkipThisDir)
continue;
//DoSometing
}