标签:include mkdir fail ring file exist string bsp bool
#include <QDir> //头文件
QDir *TEST = new QDir;
bool exist = TEST->exists("TEST");
if(!exist)
bool ok = TEST->mkdir("TEST");
QString fileName = "TEST/1.txt";
QString str="今天的天气很好适合跑步";
QFile file(fileName);
if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append))
{
qDebug() << "open fail!" << endl;
}
QTextStream in(&file);
in<<":"+str<<"\n";
file.close();
标签:include mkdir fail ring file exist string bsp bool
原文地址:https://www.cnblogs.com/wanghuixi/p/9293338.html