I'm using the following code to write some text to a file:
QFile caFile(outputFolder + "file.extension");
caFile.open(QIODevice::WriteOnly | QIODevice::Text);
if(!caFile.isOpen()){
qDebug() << "- Error, unable to open" << "outputFilename" << "for output";
}
QTextStream outStream(&caFile);
outStream << "First Line\nSecond Line\nThird Line";
caFile.close();
It's working like a charm, but with a little problem .. The text file should look like this:
First Line
Second Line
Third Line
But instead, it looks like this:
First Line
Second Line
Third Line
What's the problem here?