QString sharedFolderPathImg = "\\\\"+ IP +"/profileImage/"; // 更换为你的共享文件夹路径QDir dirImg(sharedFolderPathImg);dirImg.setFilter(QDir::NoDotAndDotDot | QDir::AllEntries);QVector<QString> curFileEntryArrayImg = dirImg.entryList().toVector();for (auto filename : curFileEntryArrayImg){QFile sharedFile(sharedFolderPathImg + filename);QFile oldFile("C:/chenhe/profileImage/" + filename);if (oldFile.exists()) {oldFile.remove();}//qDebug() << filename;sharedFile.copy("C:/chenhe/profileImage/"+ filename);}
]