QDir 创建目录
做到tableView导出Excel时,创建文件目录:mkdir 发现一直没有创建 ,然后F1观看帮助文档:
bool QDir::mkdir(const QString &dirName) const
Creates a sub-directory called dirName.
创建名为dirName的子目录。
Returns true on success; otherwise returns false.
If the directory already exists when this function is called, it will return false.
See also rmdir().
bool QDir::mkpath(const QString &dirPath) const
Creates the directory path dirPath.
The function will create all parent directories necessary to create the directory.
创建目录路径dirPath。
该函数将创建创建该目录所需的所有父目录。
Returns true if successful; otherwise returns false.
If the path already exists when this function is called, it will return true.
See also rmpath().
看一下代码吧,.cpp文档:
#include <QDir><