title: How write to the file continuously in Qt?
body: <p>I have written this piece of code as a function, each time I call this function, I want to write to the file.But this function writes only once to the file.whenever I open the file from windows I find only one word written to the file. How to write in the file continuously each time I call?</p>
  
  <pre><code>/* Try and open a file for output */
      QString outputFilename = "Results.txt";
      QFile outputFile(outputFilename);
      outputFile.open(QIODevice::WriteOnly);
  
      /* Check it opened OK */
      if(!outputFile.isOpen()){
      qDebug() &lt;&lt;"- Error, unable to open" &lt;&lt; outputFilename &lt;&lt; "for output";
      return ;
      }
  
      /* Point a QTextStream object at the file */
      QTextStream outStream(&amp;outputFile);
  
      /* Write the line to the file */
      outStream &lt;&lt;"\n"&lt;&lt; szTemp;//"Victory!\n";
  
      /* Close the file */
      outputFile.close();
  </code></pre>