Skip to content Skip to sidebar Skip to footer

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()) self.mytext.setTextCursor(sel

Solution 1:

moveCursor method should do that. e.g.:

self.mytext.moveCursor(QtGui.QTextCursor.End)

Solution 2:

I've found the following to work:

from PyQt4 import QtGui

self.display = QtGui.QTextBrowser()
self.display.verticalScrollBar().setValue(
    self.display.verticalScrollBar().maximum())

Good luck!

Solution 3:

self.mytext.ensureCursorVisible()

Post a Comment for "Autoscroll Pyqt Qtextwidget"