qint64 GetFolderSize(QString folder)
{
QDir dir(folder)
if (!dir.exists())
return 0
qint64 totalsize = 0
拆档QFileInfoList list = dir.entryInfoList()
旅运乱 for(int ii=0 ii<list.size() 悄陵ii++)
{
QFileInfo fileInfo = list.at(ii)
if (fileInfo.isFile())
totalsize += fileInfo.size()
else if(fileInfo.isDir())
{
totalsize += GetFolderSize(fileInfo.path)
}
}
return totalsize
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)