title: Getting visible text from a QTextEdit in PyQt
body: <p>This is related to another question I found here that seems to be inactive for a few months, so I think it's worth asking again.</p>
  
  <p>I have created a simple QDialog that has a QTextEdit and a QPushButton. This pops up in my application when a user right-clicks and selects the option to "add comments". I want them to be able to write free-form text and I'll just save whatever they write as a long string with no concern for new lines, etc.</p>
  
  <p>When the user clicks the button, it executes code like this:</p>
  
  <pre><code>    self.connect(accept_button,QtCore.SIGNAL('clicked()'),lambda arg=str(view_textedit.toPlainText()): self.updateGroupComments(arg))
  
  def updateGroupComments(self,new_comment_str):
      print "Updating user comment to have new string: " + new_comment_str
      self.group_entry.list_of_user_comments[self.currentFrameCounter] = new_comment_str
  </code></pre>
  
  <p>This is not detecting the TextEdit text that is visible (it only detects whatever the text edit text is set to when it is created). How do I make a simple command that returns the currently visible text from a QTextEdit. Again, the function</p>
  
  <pre><code>toPlainText()
  </code></pre>
  
  <p>is not working correctly... it doesn't find the currently visible text, only whatever text was on screen before changes or additions started being made by the user.</p>
  
  <p>If this can't be done without subclassing and appealing to cursor positions, it makes the whole thing seem worthless... so please keep suggestions only to those implemented without subclassing or manipulating cursors. It should be really simple and straightforward to just return all currently visible text... what am I missing?</p>