There is no default auto-scroll feature, but you can make the behavior relatively simple. Your model will highlight rowsInserted when inserting / adding rows. You can connect to this signal and call scrollToBottom in your view.
However, there is one problem. The view needs to adjust itself because it will not place the element at the bottom when rowsInserted . Calling scrollToBottom within QTimer.singleShot solves this because QTimer will wait until there are pending events (for example, updating the view).
Assuming the model is stored as self.model and the view is self.view , here is how it would look:
self.model.rowsInserted.connect(self.autoScroll)
and autoScroll :
def autoScroll(self): QtCore.QTimer.singleShot(0, self.view.scrollToBottom)
Or, if you prefer not to have a separate method for this:
self.model.rowsInserted.connect(lambda: QtCore.QTimer.singleShot(0, self.view.scrollToBottom))
source share