title: How to set the QLineEdit with new line
body: <p>Currently I am copying the text to a LineEdit and on click PushButton it will write the text to a file which is "data.txt". I have written a <code>readfile()</code> which will read the text from data.txt and on click PushButton it should display the text in new line format at LineEdit.
  Here is my code:</p>
  
  <pre><code>    void MainWindow::writefile()
      {
          QString str = ui-&gt;lineEdit-&gt;text();
          QString filename = "data.txt";
          QFile file(filename);
          file.open(QIODevice::WriteOnly|QIODevice::Text);
          QTextStream out(&amp;file);
          out&lt;&lt;str&lt;&lt;endl;
          file.close();
      }
      void MainWindow::readfile()
      {
          QString filename = "data.txt";
          QFile file(filename);
          file.open(QIODevice::ReadOnly|QIODevice::Text);
          QTextStream  in(&amp;file);
          QString str = in.readLine();
          ui-&gt;lineEdit_2-&gt;setText(str);
          file.close();
      }
  void MainWindow::on_pushButton_2_clicked()
  {
      readfile();
  }
  void MainWindow::on_pushButton_clicked()
  {
      writefile();
  }
  </code></pre>
  
  <p>Please suggest how to separate those comma-separated strings and must display in new line format </p>
  
  <p><img src="https://i.stack.imgur.com/zchaZ.jpg" alt="File Input Output"></p>