如何在 XML 中编写 XML 文本?
QXmlStreamWriter xmlWriter(&file);
(...)
QString xmlCode = "This is a <b>XML</b> code. And should be written as is it";
xmlWriter.writeStartElement("start");
xmlWriter.writeCharacters(xmlCode);
xmlWriter.writeEndElement();
输出应该是:
<start>
This is a <b>XML</b> code. And should be written as is it
</start>