QTextEdit and QPlainTextEdit are both inherited from QAbstractScrollArea. The QAbstractScrollArea object provides access to the scrollbar through the verticalScrollBar() method.
Thus, to jump to the top:
ui.textEdit->verticalScrollBar()->setValue(0);
And to jump to the bottom:
ui.textEdit->verticalScrollBar()->setValue(ui.textEdit->verticalScrollBar()->maximum());
This should work for both QTextEdit and QPlainTextEdit.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…