QFile log("d:\testlog.txt");
if(!log.open(QIODevice::ReadWrite))
{
return false;
}
log.write("start-");
log.flush();
log.write(QString("Num:%1-").arg(num).toUtf8());
log.flush();
log.write(QString("size:%1-").arg(QString::number(tempFile.size())).toUtf8());
log.flush();
连续追加
QFile log("d:\testlog.txt");
log.open(QIODevice::Append);
log.write("start-
");
log.flush();
log.write(QString("size:%1-").arg(QString::number(tempFile.size())).toUtf8());
log.flush();