title: Reading strings from file. QTextStream does not read file
body: <p>I need to read strings from foo.txt:</p>
  <pre><code>#include &lt;QDebug&gt;
  #include &lt;QFile&gt;
  #include &lt;QStringList&gt;
  #include &lt;QTextStream&gt;
  
  int main( int argc, char** argv )
  {
      QFile file(&quot;foo.txt&quot;);
      if (!file.open(QIODevice::ReadOnly))
          return 1;
      QStringList stringList;
      QTextStream textStream(&amp;file);
      textStream.readLine();
      while (!textStream.atEnd())
          stringList &lt;&lt; textStream.readLine();
  
      file.close();
  
      qDebug() &lt;&lt; stringList;
  
      return 0;
  }
  </code></pre>
  <p><img src="https://i.stack.imgur.com/Zhojj.jpg" alt="outPut" /></p>
  <p>file opened, but textStream always empty.</p>