When we use ui->TextEdit->append("...")
the text entered will be shown in a new line in the TextEdit section. What I want to do is to write on the same line... I've tried this code:
ui->textEdit->append("My name is:");
ui->textEdit->append("\b bla");
but it seems that "\b" isn't recognised by Qt
Maybe an option is to do the append outside of the QTextEdit to avoid having a new paragraph created:
QString text = ui->textEdit->text();
text.append("bla");
ui->textEdit->setText(text);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.