How to scroll QPlainTextEdit to top?

martin k picture martin k · Sep 2, 2011 · Viewed 8.9k times · Source

I would like to automatically scroll to the top in a QPlainTextEdit widget after put in some text. How can I realize that?

Answer

TonyK picture TonyK · Sep 2, 2011
myTextEdit -> moveCursor (QTextCursor::Start) ;
myTextEdit -> ensureCursorVisible() ;