标签: c++ file qt qfile
如何打开QFile进行追加,即相当于
FILE *f = fopen("myfile.txt", "a");
答案 0 :(得分:42)
以QIODevice::Append模式打开文件:
QIODevice::Append
QFile f(...); if (f.open(QIODevice::WriteOnly | QIODevice::Append)) { ... }
另请参阅documentation。