Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找不到如何更改 QTextEdit 上的托架位置。我使用 setText(或 setPlainText)方法添加文本,并且在此回车位于 QTextEdit 输入字段的开头之后,我希望它位于最后一个符号之后。
QTextCursor cursor = myQTextEdit.textCursor(); cursor.movePosition(QTextCursor::End); myQTextEdit.setTextCursor(cursor);
或者如果它不起作用,请交换第 2 行和第 3 行。