Qt 获取文件夹下所有文件

Qt 获取文件夹下所有文件代码如下:

QStringList getFileNames(const QString &path)
{
    QDir dir(path);
    QStringList nameFilters;
    nameFilters << "*.jpg" << "*.png";
    QStringList files = dir.entryList(nameFilters, QDir::Files|QDir::Readable, QDir::Name);
    return files;
}
原文地址:https://www.cnblogs.com/rainbow70626/p/10319759.html