37 #include <QTextStream> 47 if (!file.open(QIODevice::ReadOnly))
49 reportError(
"Could not open XML file :" + file.fileName() +
".");
50 return QDomDocument();
56 if (!retval.setContent(&file,
false, &emsg, &eline, &ecolumn))
58 reportError(
"Could not parse XML file :" + file.fileName() +
" because: " + emsg +
"");
59 return QDomDocument();
68 if (file.open(QIODevice::WriteOnly | QIODevice::Truncate))
70 QTextStream stream(&file);
71 stream << doc.toString(4);
76 reportError(
"Could not open " + file.fileName() +
" Error: " + file.errorString());
static void writeXmlFile(QDomDocument &doc, QString &filename)
void reportError(QString msg)
static QDomDocument readXmlFile(QString &filename)
Namespace for all CustusX production code.