0

i want write a string to a text file when i press the button but no matter how much i press the button the string gets written on the first line on the text file so how can i do it? My code inside the buttons function is this:

QFile filename(".../Save.txt");
filename.open(QIODevice::WriteOnly | QIODevice::Text);   
QTextStream stream(&filename);
QString str = "Line";
stream << str << endl;
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Faeyan
  • 1

0 Answers0