I want to read an xml file as follow:
QFile myFile("xmlfile");
and then continue with parsing the xml starting from :
QXmlStreamReader xmlData(myFile);
.. the error I get is:
no matching function for call to 'QXmlStreamReader::QXmlStreamReader(QFile&)'
so what is the problem and how to solve it ?
question update: Based on the selected answer below, the code is now working without a syntax error .
however, I can not read my xml. when parsing the xml, I use the following to read xml elements:
QXmlStreamReader::TokenType token = xmlElements.readNext();
then this code for checking the startElements:
while(!xmlElements.atEnd() && !xmlElements.hasError()){ // the breakpoint is here
do ...
}
so, at this breakpoint, I notice in my debuger that token value is QXmlStreamReader::Invalid(1)
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 ?