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 許可 進一步瞭解細節。