On this page

QXmlStreamEntityResolver Class

The QXmlStreamEntityResolver class provides an entity resolver for a QXmlStreamReader. More...

Header: #include <QXmlStreamEntityResolver>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

Note: All functions in this class are reentrant.

Public Functions

QXmlStreamEntityResolver()
virtual ~QXmlStreamEntityResolver()
virtual QString resolveUndeclaredEntity(const QString &name)

Detailed Description

Use to inform QXmlStreamReader how to expand entities not declared in the internal-set of the DTD.

See also QXmlStreamReader::setEntityResolver().

Member Function Documentation

[constexpr noexcept default] QXmlStreamEntityResolver::QXmlStreamEntityResolver()

Default-constructs an instance of QXmlStreamEntityResolver.

[virtual noexcept] QXmlStreamEntityResolver::~QXmlStreamEntityResolver()

Destroys the entity resolver.

[virtual] QString QXmlStreamEntityResolver::resolveUndeclaredEntity(const QString &name)

Reimplement this function to resolve the undeclared entity name and return its replacement text. If the entity is unknown to the entity resolver, return a null string: QString(). This will raise an error in QXmlStreamreader. An empty, but non-null string is considered a valid expansion of the entity, and will not cause an error.

The default implementation always returns QString().

© 2026 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.