title: Converting valid QFile to QString - QString is empty
body: <p>So I am trying to convert a QFile into a QString by doing the following:</p>
  
  <pre><code>void MainWindow::openTemplateFile(QString location)
  {
      if (location.isEmpty())
          return;
      else
      {
          QString variable;
          templateFile.setFileName(location);
          if (!templateFile.open(QFile::ReadOnly | QFile::Text))
          {
              QMessageBox::information(this, "Unable to open template", 
              templateFile.errorString());
              return;
          }
  
          else    // file opened and ready to read from
          {
              QTextStream in(&amp;templateFile);
              QString fileText = in.readAll();
              qDebug() &lt;&lt; templateFile.size() &lt;&lt; in.readAll();
          }
      }
  }
  </code></pre>
  
  <p>However, in I get the following result in the debug console:</p>
  
  <pre><code>48 ""
  </code></pre>
  
  <p>templateFile does exist and is part of the MainWindow class. This is also simplified code - in the actual program I read chars from the file and it works correctly. The location string is a result of the QFileDialog::getOpenFileName function, which I open a txt file with.</p>