16 #include <QTextStream>
26 if (!file.open(QIODevice::ReadOnly))
28 reportError(
"Could not open XML file :" + file.fileName() +
".");
29 return QDomDocument();
35 if (!retval.setContent(&file,
false, &emsg, &eline, &ecolumn))
37 reportError(
"Could not parse XML file :" + file.fileName() +
" because: " + emsg +
"");
38 return QDomDocument();
47 if (file.open(QIODevice::WriteOnly | QIODevice::Truncate))
49 QTextStream stream(&file);
50 stream << doc.toString(4);
55 reportError(
"Could not open " + file.fileName() +
" Error: " + file.errorString());