title: How to search for a string in a text file using Qt
body: <p>I'm trying to search for a string in a text file; my aim is to write it only if it isn't already written inside my text file. </p>
  
  <p>Here's my function (I don't know how to put inside the while loop):</p>
  
  <pre><code>QFile MyFile("text.txt");
  MyFile.open(QIODevice::ReadWrite);
  QTextStream in (&amp;MyFile);
  
  while(!MyFile.atEnd())
    { //do something to search string inside }
  
  MyFile.close();
  </code></pre>
  
  <p>How can I do that? From Qt's Help, method "contains" works with const variable only; can I use it to look for my string?</p>