Sur cette page

QDomComment Class

La classe QDomComment représente un commentaire XML. Plus d'informations...

En-tête : #include <QDomComment>
CMake : find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake : QT += xml
Héritages : QDomCharacterData

Note : Toutes les fonctions de cette classe sont réentrantes.

Fonctions publiques

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

Description détaillée

Un commentaire dans le XML analysé tel que celui-ci :

<!-- this is a comment -->

est représenté par des objets QDomComment dans l'arbre Dom analysé.

Pour plus d'informations sur le Document Object Model, voir le Niveau 1 et le Niveau 2 Core. Pour une introduction plus générale de l'implémentation du DOM, voir la documentation QDomDocument.

Documentation des fonctions membres

QDomComment::QDomComment()

Construit un commentaire vide. Pour construire un commentaire avec du contenu, utilisez la fonction QDomDocument::createComment().

QDomComment::QDomComment(const QDomComment &comment)

Construit une copie de comment.

Les données de la copie sont partagées (copie superficielle) : modifier un noeud modifiera également l'autre. Si vous voulez faire une copie profonde, utilisez cloneNode().

QDomNode::NodeType QDomComment::nodeType() const

Retourne CommentNode.

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

Assigne other à ce commentaire DOM.

Les données de la copie sont partagées (copie superficielle) : modifier un nœud modifiera également l'autre. Si vous voulez faire une copie profonde, utilisez 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.