Getting the rows in a qtablewidget to new lines in a textfile in qt c++

follwing code is used by me to read tablewidget rows and get the contents into a Qstring and then put the string into a textfile. Currently all the rows appear as single line in the textfile! How can I display each row as separate line?