开发者

Newline character into textfile using QFile

i want to put a newline into a txt file, i tried with many alternative with so many help from this forum b开发者_如何学运维ut i am getting always unknown character always. Please help

for (int i = 0; i < fileDet.size(); i++) {
  qDebug() << "Name directory" << fileDet.at(i);
  QFile data("output.txt");
  if (data.open(QFile::Append)) {
    QTextStream out(&data);
    out << fileDet.at(i);  //<<'\n';
    out << QChar((int)'\n');
  }
  data.close();
}


Try out << endl;


When you open the file:

data.open(QFile::Append | QFile::Text)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜