QTextCursor textCursor=ui->textEdit->textCursor();
textCursor.movePosition(QTextCursor::End);
ui->textEdit->setTextCursor(textCursor);