auto folder1="./.mm";
QDir *folder = new QDir;
bool exist = folder->exists(folder1);
if(exist)
{
QMessageBox::warning(this, tr("createDir"), tr("Dir is already existed!"));
}
else
{
//创建文件夹
bool ok = folder->mkdir(folder1);
if(ok)
QMessageBox::warning(this, tr("CreateDir"), tr("Create Dir success!"));
else
QMessageBox::warning(this, tr("CreateDir"), tr("Create Dir fail"));
}
标签:folder1,qt,work,tr,warning,QMessageBox,folder,Dir
From: https://blog.51cto.com/u_4018548/6445818