1、文件是否存在
bool IsFileExist(const QString& strPath)
{
QFileInfo fileInfo(strPath);
if (fileInfo.isFile())
{
return true;
}
return false;
}
2、创建空的文件
bool CreateEmptyFile(const QString& strPath)
{
QFile m_file;
bool bIsCraete = false;
bool bIsExist = IsFileExist(strPath);
if (!bIsExist)
{
bIsCraete = m_file.open