countFiles += dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot).count();
foreach (QString subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)){ ++countFiles; dirs.push(path + QDir::separator() + subDir);}
foreach (QString file, dir.entryList(filters)) { if (QFileInfo(dir, file).isDir()){ ++countFiles; dirs.push(path + QDir::separator() + dir); } else { listFiles << QFileInfo(dir, file).absoluteFilePath(); } }
C++ (Qt) foreach (QString file, dir.entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot)) { QFileInfo temp(dir,file); if(temp.isDir()) dirs.push(path + QDir::separator() + file); else if(m_FilterNames.contains("*." + temp.completeSuffix())) listFiles << QFileInfo(dir, file).absoluteFilePath(); }
C++ (Qt)foreach (QString file, dir.entryList(filters)) { listFiles << QFileInfo(dir, file).absoluteFilePath(); } foreach (QString subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)){ dirs.push(path + QDir::separator() + subDir); }