0

I can't find how to change carriage position on QTextEdit. I add text with setText(or setPlainText) methods, and after this carriage is at the beginning of QTextEdit input field, and I want it to be right after last symbol.

Hate
  • 1,185
  • 3
  • 12
  • 24

1 Answers1

1
QTextCursor cursor = myQTextEdit.textCursor();
cursor.movePosition(QTextCursor::End);
myQTextEdit.setTextCursor(cursor);

Or if it won't work, swap lines 2 and 3.

Blood
  • 4,126
  • 3
  • 27
  • 37