title: QT Can't read from a file
body: <p>I am trying to open a file from a specific location and it seems to find the path properly, but I can't figure out why it always skips the while loop.</p>
  
  <pre><code>QString utm_file_loc = "C:\\Example\\test\\UTM_Zone.config";
  QFile fileutm(utm_file_loc);
  QTextStream utm_in(&amp;fileutm);
  QString value;
  while(!utm_in.atEnd())
  {
      QString line = utm_in.readLine();               
      line.replace(" ", "");
      if( (line.indexOf("#") &lt;0 || 1 &lt; line.indexOf("#")) &amp;&amp;
          (line.contains("UTM_ZONE=")) )
      {
          value = line.mid(line.indexOf("=")+1);
          break;
      }
  }
  </code></pre>
  
  <p>The config file is 1 line and contains UTM_ZONE = 17</p>
  
  <p>I thought it might have to do with it being 1 line and so it always thinks it's at the end, but I tried adding more lines before and after to the file and it still skips the loop.</p>