ui->textEdit->verticalScrollBar()->setValue(ui->textEdit->verticalScrollBar()->maximum());
This should work for both QTextEdit and QPlainTextEdit.
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.