En esta página

QDomComment Class

La clase QDomComment representa un comentario XML. Más información...

Encabezado: #include <QDomComment>
CMake: find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake: QT += xml
Heredado de: QDomCharacterData

Nota: Todas las funciones de esta clase son reentrantes.

Funciones públicas

QDomComment()
QDomComment(const QDomComment &comment)
QDomNode::NodeType nodeType() const
QDomComment &operator=(const QDomComment &other)

Descripción detallada

Un comentario en el XML analizado, como este:

<!-- this is a comment -->

se representa mediante objetos QDomComment en el árbol DOM analizado.

Para obtener más información sobre el Modelo de Objetos de Documento (DOM), consulta los niveles 1 y 2 del núcleo. Para una introducción más general a la implementación del DOM, consulta la documentación de QDomDocument.

Documentación de funciones de miembro

QDomComment::QDomComment()

Crea un comentario vacío. Para crear un comentario con contenido, utiliza la función ` QDomDocument::createComment()`.

QDomComment::QDomComment(const QDomComment &comment)

Crea una copia de comment.

Los datos de la copia son compartidos (copia superficial): al modificar un nodo, también se modificará el otro. Si deseas realizar una copia profunda, utiliza cloneNode().

QDomNode::NodeType QDomComment::nodeType() const

Devuelve « CommentNode ».

QDomComment &QDomComment::operator=(const QDomComment &other)

Asigna ` other ` a este comentario del DOM.

Los datos de la copia se comparten (copia superficial): al modificar un nodo, también se modificará el otro. Si deseas realizar una copia profunda, utiliza cloneNode().

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