• 3749阅读
  • 2回复

取已知路径下的文件 [复制链接]

上一主题 下一主题
离线wsszlj
 

只看楼主 倒序阅读 楼主  发表于: 2009-09-23
知道了一个路径,如何取得这个路径下面的所有文件啊,不包括文件夹?
离线dbzhang800

只看该作者 1楼 发表于: 2009-09-23
获取就可以,是不是文件夹你可以自己判断

看manual

QStringList QDir::entryList ( const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort ) const

Returns a list of the names of all the files and directories in the directory, ordered according to the name and attribute filters previously set with setNameFilters() and setFilter(), and sorted according to the flags set with setSorting().

The name filter, file attribute filter, and sorting specification can be overridden using the nameFilters, filters, and sort arguments.

Returns an empty list if the directory is unreadable, does not exist, or if nothing matches the specification.
离线wsszlj

只看该作者 2楼 发表于: 2009-09-23
OK,谢谢!
快速回复
限100 字节
 
上一个 下一个