문제

How can I open a QFile for appending, i.e. the equivalent of

FILE *f = fopen("myfile.txt", "a");
도움이 되었습니까?

해결책

Open the file in QIODevice::Append mode:

QFile f(...);
if (f.open(QIODevice::WriteOnly | QIODevice::Append)) {
  ...
}

See also the documentation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top