1. 程式人生 > >QT 通過後綴名過濾檔案型別

QT 通過後綴名過濾檔案型別

QFileInfoListScanDir::ScanDirToFindallPicture(QFileInfoListlist)
{
QFileInfoListpictureList;
QStringfilter;
foreach(QFileInfofileinfo,list)
{
//_filter=_fileinfo.completeSuffix();
filter=fileinfo.suffix();//字尾名
filter=filter.toLower();
if((filter=="jpeg")||(filter=="png")
||(filter=="jpg")||(filter=="bmp"))
{
pictureList.append(fileinfo.absoluteFilePath());
}else{

}
}
returnpictureList;
}