14 using namespace Qt::Literals;
16 if (!source.exists() || !dest.exists())
19 QDirIterator it(source, QDirIterator::Subdirectories);
21 while (it.hasNext()) {
22 QFileInfo file{ it.next() };
23 const QString relativePath = source.relativeFilePath(file.absoluteFilePath());
24 const QString destination = dest.absolutePath() + u"/"_s + relativePath;
27 if (QFile::exists(destination))
28 if (!QFile::remove(destination))
31 if (!QFile::copy(file.absoluteFilePath(), destination))
34 }
else if (file.isDir()) {
35 if (!QDir(destination).exists())
36 if (!dest.mkpath(relativePath))