Writing data into a text-file
Solved
General and Desktop
-
Dear all,
my qt-program calculates data and I want to store them in a text-file.
But the problem is, that the program overrides the same line every time.QFile file("C:/Users/frti1017/Documents/GUI-Vision/result_storage.txt"); if(file.open(QIODevice::WriteOnly | QIODevice::Text)) { // We're going to streaming text to the file QTextStream stream(&file); stream << "Center Point: " << iter_result[0] << " " << iter_result[1] << " " << iter_result[2] << " Rotation: " << iter_result[3] <<'\n'; file.close(); qDebug() << "Writing finished"; }
How can I write every line of data in a new line?
Thanks a lot.
Kindly regards,
Timo -