QXmlLocator Class
QXmlLocator 类为 XML 处理程序类提供文件中解析位置的信息。更多
Header: | #include <QXmlLocator> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core5Compat) target_link_libraries(mytarget PRIVATE Qt6::Core5Compat) |
qmake: | QT += core5compat |
注意:该类中的所有函数都是可重入的。
公共函数
QXmlLocator() | |
virtual | ~QXmlLocator() |
virtual int | columnNumber() const = 0 |
virtual int | lineNumber() const = 0 |
详细说明
阅读器在开始解析文档前会向内容处理程序报告 QXmlLocator。这是通过QXmlContentHandler::setDocumentLocator() 函数完成的。处理程序类现在可以使用该定位器来获取阅读器已到达的位置(lineNumber() 和columnNumber() )。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.