baray98
29th July 2008, 21:23
I was trying to save some text from my QTextBrowser to a file like below
QString strFile = QFileDialog::getSaveFileName(this);
if (!strFile.isEmpty())
{
QFile myFile(strFile);
if (myFile.open(QIODevice::WriteOnly))
myFile.write(text().toUtf8());
}
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....
QString strFile = QFileDialog::getSaveFileName(this);
if (!strFile.isEmpty())
{
QFile myFile(strFile);
if (myFile.open(QIODevice::WriteOnly))
myFile.write(text().toUtf8());
}
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....