ADE ADE - 1 year ago 134
Python Question

Autoscroll PyQT QTextWidget

How can I autoscroll to the bottom of my QTextEdit

in my GUI init function

self.mytext = QTextEdit()
self.cursor = QTextCursor(self.mytext.document())

and how I am adding to it in another function

self.cursor.insertText(str(self.user) + ": " + str(self.line.text()) + "\n")

any ideas *cheers

Answer Source

moveCursor method should do that. e.g.: