使用QDir::entryList获取文件列表,返回为空

版权声明:转载请注明出处 https://blog.csdn.net/understand125/article/details/53148236

        若要搜索指定目录下所有文件(包含文件夹),使用QDir::entryList时,Filter需指定“QDir::Dirs | QDir::Files”,否则无法获取到文件列表,若需忽略“./,../”等,filter还需加上“QDir::NoDotAndDotDot”,或自行根据文件名,过滤!


        注:获取文件名方法:QFileInfo(dirPath,fileName).fileName()

猜你喜欢

转载自blog.csdn.net/understand125/article/details/53148236