在这里插入图片描述
这里使用

QStorageInfo info(QDir(path));

创建就会报错

改为

// 获取给定路径所在的磁盘信息
QDir d(path);
QStorageInfo info(d);

在这里插入图片描述

就不会报错,怪噻!

更多推荐