PDA

View Full Version : QTextEdit::append help



tho97
29th November 2007, 01:39
I want to append the text into QTextEdit 1 line after another, but whenever I use append(), it gives a text then new empty line then the next text. How can I rewrite the append() to make it not insert the new line into QtextEdit ?
like

line1
line2
line3

not like (with append())
line1

line2

line3

jpn
29th November 2007, 07:10
QTextEdit::append() inserts a new block so you don't have to append any newline characters.

I presume you have:


textEdit->append("line1\n");
textEdit->append("line2\n");
textEdit->append("line3\n");

However, you should do:


textEdit->append("line1");
textEdit->append("line2");
textEdit->append("line3");