텍스트 파일에 줄 바꿈을 추가하고 싶지만 아무 반응이 없습니다.텍스트 파일에 쓰는 동안 줄을 끊는 방법
void controleformules::on_pushButton_4_clicked(
{
QString str= ui->textEdit_2->toPlainText();
QString filename= str+".txt";
QFile file(filename);
if (file.open(QIODevice::ReadWrite))
{
QTextStream stream(&file);
stream
<< "U heeft nu deze 2 formules gekozen: Formule 1: " << x1Int << " + " << y1Int << " = " << r1Int << ". Formule 2: "<< x2Int << " + " << y2Int << " = " << r2Int << "." << '\n'
<<"eerst moet je in beide formules de x of de y elimeneren, wij doen de y eerst";
}
}
내가 미리 팀 스 미츠 모두 "\n"
및 '\n'
, 나는 누군가가 나를 도울 수 있기를 바랍니다
,
감사를 시도
참조 : http://stackoverflow.com/questions/4181630/how-can-i-place-a-line-break-while-writing-to-a-file 창을 사용하는 경우, "\ r \ n"이 필요합니다 – Ian
"\ n"의 의미를 확인하십시오. – m0skit0
텍스트 파일을 어떻게보고 있습니까? 캐릭터가 실제로 출력되지 않습니까, 아니면 독자가 무시하는 것입니까? –