This commit is contained in:
2019-02-21 17:12:16 +01:00
parent 49d098c2d7
commit f10552c711
8 changed files with 130 additions and 66 deletions
+25 -1
View File
@@ -41,7 +41,7 @@ QByteArray image2Blob(const QImage &image)
QStandardItem* insertPath(QString szPath, QStandardItem* lpRootItem)
{
if(!lpRootItem)
return(0);
return(nullptr);
QString szPath1 = szPath.replace("\\", "/");
QStringList szPathList = szPath1.split("/");
@@ -85,3 +85,27 @@ QStandardItem* insertPath(QString szPath, QStandardItem* lpRootItem)
return(lpCurRoot);
}
bool copyFile(const QString& szSource, const QString& szDest, bool bDelete)
{
QString szDestPath;
QString szDestFilePath = szDest;
QDir dir;
QFile file;
szDestFilePath.replace("\\", "/");
szDestPath = szDestFilePath.left(szDestFilePath.lastIndexOf("/"));
dir.mkpath(szDestPath);
if(file.exists(szDestFilePath))
file.remove(szDestFilePath);
file.copy(szSource, szDestFilePath);
if(bDelete)
file.remove(szSource);
return(true);
}