Qt XML

The Qt XML module provides an implementation of the DOM standard for XML.

注意: Qt XML will no longer receive additional features. For reading or writing XML documents iteratively (SAX), use the QXmlStreamReader and QXmlStreamWriter 类。这 2 个类更易于使用,且更兼容 XML 标准。

The Qt XML C++ 类 页面给出此模块中可用类的概述。

使用模块

使用 Qt 模块要求直接或透过其它依赖链接到模块库。一些构建工具为此有贡献支持,包括 CMake and qmake .

构建采用 CMake

使用 find_package() 命令定位所需模块组件在 Qt6 包:

find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
					

另请参阅 构建采用 CMake 概述。

采用 qmake 构建

To configure the module for building with qmake, add the module as a value of the QT variable in the project's .pro file:

QT += xml
					

Module Evolution

Changes to Qt XML lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.

许可

Qt XML 模块在商业许可下是可用的来自 Qt 公司 . In addition, it is available under free software licenses: The GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。