I was trying to save some text from my QTextBrowser to a file like below

Qt Code:
  1. QString strFile = QFileDialog::getSaveFileName(this);
  2. if (!strFile.isEmpty())
  3. {
  4. QFile myFile(strFile);
  5. if (myFile.open(QIODevice::WriteOnly))
  6. myFile.write(text().toUtf8());
  7.  
  8. }
To copy to clipboard, switch view to plain text mode 

now when i look at my saved file in NotePad its one big long line but in the WordPad its okey meaning lines (newlines) are the same as what i saw in my QTextBrowser.

Does it mean that there a special thingy for notepad?

baray98

P.S.
I also tried using QTextStream to save it....