实现 判断一个文件是否存在 bool isExistSpecificFile(QString strPath) { if (QFile::exists(strPath)) { return true; } return false; } 注意: 这里的路径strPath是指文件所在的绝对路径,即完整的文件路径。