title: PyQt reading text from a QTextEdit widget
body: <p>I am trying to write a program which reads data in from a file into a QTextEdit box and also a QTable widget. You should be able to edit the data in the textedit and the changes should appear in the table and viceversa.</p>
  
  <p>My problem is that when I read data back out of the textedit box into a file or variable, it gets rid of the newline character so when I try to use a <code>for line in text</code> statement, the result gives me single characters instead of lines. However, when I print the variable text to the screen, however, it appears correctly with newlines in the right places.</p>
  
  <p>Here is some sample code:</p>
  
  <pre><code>for line in self.entries[FileDisplay].toPlainText():            
      print line
  </code></pre>