title: How to add a break to a line while writing to a text file
body: <p>I want to add a line break in a text file but nothing happens.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>void controleformules::on_pushButton_4_clicked(
  {
   QString str= ui-&gt;textEdit_2-&gt;toPlainText();
  
   QString filename= str+".txt";
  
   QFile file( filename );
  
   if ( file.open(QIODevice::ReadWrite) )
   {
  
      QTextStream stream( &amp;file );
  
        stream
                &lt;&lt; "U heeft nu deze 2 formules gekozen: Formule 1: " &lt;&lt; x1Int &lt;&lt; " + " &lt;&lt; y1Int &lt;&lt; " = " &lt;&lt; r1Int &lt;&lt; ". Formule 2: "&lt;&lt; x2Int &lt;&lt; " + " &lt;&lt; y2Int &lt;&lt; " = " &lt;&lt; r2Int &lt;&lt; "." &lt;&lt; '\n'
                &lt;&lt;"eerst moet je in beide formules de x of de y elimeneren, wij doen de y eerst";
     }
  }
  </code></pre>
  
  <p>I tried both <code>"\n"</code> and <code>'\n'</code>,</p>
  
  <p>I hope someone can help me,</p>
  
  <p>Thanks in advance Tim Smits</p>