Qt遍历目录下的文件
Qt遍历目录下的文件
QList<QString> getAllPCDFileName(QString dirPath) { QList<QString> list1; QDir dir1(dirPath); dir1.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList listFileInfo = dir1.entryInfoList(); if (listFileInfo.count()>0) { for (int i = 0; i < listFileInfo.count(); i++) { QFileInfo file_info = listFileInfo.at(i); QString absolute_file_path = file_info.absoluteFilePath(); qDebug() << "" << absolute_file_path; list1.append(absolute_file_path); } } return list1; }
#######################
QQ 3087438119