Hi guys:

I got a problem that seems to be very easy to solve. I want to write a file (previously selected by the user) with some values in columns, so it is necessary to insert a "new line" character "\n"

I've tried but it doesn't work. In contrast, "\t" for a tab works properly.

I post the code here:

QFileDialog dialog(this);
QString output = dialog.getSaveFileName( this,"Save file export", "/tmp/test.txt", "Text (*.txt)");

QFile outputFile(output);
outputFile.open(QFile::ReadWrite);

QTextStream out(&outputFile);

for(int i = 0; i<myVector.size(); i++) //My vector is a QVector<double>
out << myVector.at(i) << "\n" <<endl;

The value is properly saved, but not the new line, so all values are together at the same line.

(I've tried to delete the endl, create a previos QString and then add it, etc,....)

Thanks!!!!!