This seems to work fine for me:
#include <QtGui>
#include <QtCore>
#include <QtXml>
#include <QtDebug>
int main(int argc, char **argv){
qDebug() << doc.setContent(f.readAll());
te.setPlainText(txt.text());
te.append(txt2.attribute("wert"));
te.show();
return app.exec();
}
#include <QtGui>
#include <QtCore>
#include <QtXml>
#include <QtDebug>
int main(int argc, char **argv){
QApplication app(argc, argv);
QTextEdit te;
QFile f("Test.txt");
f.open(QFile::ReadOnly);
QDomDocument doc;
qDebug() << doc.setContent(f.readAll());
QDomElement elem = doc.documentElement();
QDomElement txt = elem.firstChildElement("Test1");
te.setPlainText(txt.text());
QDomElement txt2 = elem.firstChildElement("Test2");
te.append(txt2.attribute("wert"));
te.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
In both cases I receive "Срочное выключение установки задействовано". It might be because for my system local Qt encoding is utf-8. In your case I think you should add a header to the xml file specifying the utf-8 encoding.
Bookmarks