title: How to read an XML file from the disk using Qt?
body: <p>I want to read an xml file as follow:</p>
  
  <pre><code>QFile myFile("xmlfile");  
  </code></pre>
  
  <p>and then continue with parsing the xml starting from :</p>
  
  <pre><code>QXmlStreamReader xmlData(myFile);
  </code></pre>
  
  <p>.. the error I get is:</p>
  
  <pre><code>no matching function for call to 'QXmlStreamReader::QXmlStreamReader(QFile&amp;)'
  </code></pre>
  
  <p>so what is the problem and how to solve it ?</p>
  
  <hr>
  
  <p>question update:
  Based on the selected answer below, the code is now working without a syntax error . </p>
  
  <p>however, I can not read my xml. when parsing the xml, I use the following to read xml elements:</p>
  
  <pre><code>QXmlStreamReader::TokenType token = xmlElements.readNext();
  </code></pre>
  
  <p>then this code for checking the startElements:</p>
  
  <pre><code> while(!xmlElements.atEnd() &amp;&amp; !xmlElements.hasError()){ // the breakpoint is here
   do ...
   }
  </code></pre>
  
  <p>so, at this breakpoint, I notice in my debuger that token value is <code>QXmlStreamReader::Invalid(1)</code> </p>
  
  <p>so, what is going on .. is my QStreamReader does not read the file as xml, or it read it but there is an error with the xml itself ?</p>