QDir dir(path);
QStringList filter;
filter<<"*.bmp"<<"*.jpg"<<"*.png";
infolist = dir.entryInfoList(filter);
if(infolist.isEmpty())
{
infolist.clear();
QMessageBox::information(this, "提示", "没有合适的图片文件!");
return;
}
学习笔记,转自(https://www.cnblogs.com/GEEK-ZHAO/p/14678364.html)