介绍
帮助文档:QXmlStreamReader、QXmlStreamWriter
除此以外读取时还需要使用QXmlStreamAttributes
QXml-Token标记类型
| Constant | Value | Description |
|---|---|---|
QXmlStreamReader::NoToken |
0 |
The reader has not yet read anything. |
QXmlStreamReader::Invalid |
1 |
An error has occurred, reported in error() and errorString(). |
QXmlStreamReader::StartDocument |
2 |
The reader reports the XML version number in documentVersion(), and the encoding as specified in the XML document in documentEncoding(). If the document is declared standalone, isStandaloneDocument() returns true; otherwise it returns false. |
QXmlStreamReader::EndDocument |
3 |
The reader reports the end of the document. |
QXmlStreamReader::StartElement |
4 |
The reader reports the start of an element with namespaceUri() and n |

本文介绍了如何使用QXmlStreamReader和QXmlStreamWriter在Qt中进行XML文件的读写操作。讲解了QXml-Token标记类型,提供了一个范例xml文件,并给出了读写xml的详细步骤。强调在读取时要注意完整的包含关系,避免干扰。最后提到了Qt的其他XML处理方法,如SAX和DOM方式。
最低0.47元/天 解锁文章
3476

被折叠的 条评论
为什么被折叠?



