How can i save the content of QTextEdit to a file?
I got some problem with this.
I tried this:
out << ui->QTextEdit->toPlainText() << endl;
But some information lost.
If I write:"
"in the QTextEdit , I will get "123" in the file. All the "\n" are ignored.
Anybody knows how can keep the "\n" in my file?
 code wrappings added, koahnig
I know why……
In fact, there are 3 "\n". But in windows, "\n" is replaced by "\r\n". When I copy the "123" to MSword, I finally find out that....
Just change the following lines in your code
@outfile.open(QIODevice::Append | QIODevice::Text);@
It helps me a lot!
You are welcome..!!! Please set the topic as [SOLVED].