QDomNodeList Class

Die Klasse QDomNodeList ist eine Liste von QDomNode Objekten. Mehr...

Kopfzeile: #include <QDomNodeList>
CMake: find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake: QT += xml

Hinweis: Alle Funktionen in dieser Klasse sind reentrant.

Öffentliche Funktionen

QDomNodeList()
QDomNodeList(const QDomNodeList &nodeList)
~QDomNodeList()
QDomNode at(int index) const
int count() const
bool isEmpty() const
QDomNode item(int index) const
int length() const
int size() const
bool operator!=(const QDomNodeList &other) const
QDomNodeList &operator=(const QDomNodeList &other)
bool operator==(const QDomNodeList &other) const

Detaillierte Beschreibung

Listen können durch QDomDocument::elementsByTagName() und QDomNode::childNodes() erhalten werden. Das Document Object Model (DOM) erfordert, dass diese Listen "live" sind: Wann immer Sie das zugrunde liegende Dokument ändern, wird der Inhalt der Liste aktualisiert.

Sie können einen bestimmten Knoten aus der Liste mit item() abrufen. Die Anzahl der Elemente in der Liste wird mit length() zurückgegeben.

Weitere Informationen über das Document Object Model finden Sie unter Level 1 und Level 2 Core. Eine allgemeinere Einführung in die DOM-Implementierung finden Sie in der Dokumentation QDomDocument.

Siehe auch QDomNode::childNodes() und QDomDocument::elementsByTagName().

Dokumentation der Mitgliedsfunktionen

QDomNodeList::QDomNodeList()

Erzeugt eine leere Knotenliste.

QDomNodeList::QDomNodeList(const QDomNodeList &nodeList)

Konstruiert eine Kopie von nodeList.

[noexcept] QDomNodeList::~QDomNodeList()

Zerstört das Objekt und gibt seine Ressourcen frei.

QDomNode QDomNodeList::at(int index) const

Diese Funktion wird aus Gründen der Qt-API-Konsistenz bereitgestellt. Sie ist äquivalent zu item().

Wenn index negativ ist oder wenn index >= length() ist, wird ein Null-Knoten zurückgegeben (d.h. ein Knoten, für den QDomNode::isNull() true zurückgibt).

int QDomNodeList::count() const

Diese Funktion wird aus Gründen der Qt-API-Konsistenz bereitgestellt. Sie ist äquivalent zu length().

bool QDomNodeList::isEmpty() const

Gibt true zurück, wenn die Liste keine Elemente enthält; andernfalls wird false zurückgegeben. Diese Funktion wird aus Gründen der Qt-API-Konsistenz bereitgestellt.

QDomNode QDomNodeList::item(int index) const

Gibt den Knoten an der Position index zurück.

Wenn index negativ ist oder wenn index >= length(), wird ein Null-Knoten zurückgegeben (d. h. ein Knoten, für den QDomNode::isNull() den Wert true liefert).

Siehe auch length().

int QDomNodeList::length() const

Gibt die Anzahl der Knoten in der Liste zurück.

int QDomNodeList::size() const

Diese Funktion wird aus Gründen der Qt-API-Konsistenz bereitgestellt. Sie ist äquivalent zu length().

bool QDomNodeList::operator!=(const QDomNodeList &other) const

Gibt true zurück, die Knotenliste other und diese Knotenliste sind nicht gleich; andernfalls wird false zurückgegeben.

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

Weist dieser Knotenliste other zu.

bool QDomNodeList::operator==(const QDomNodeList &other) const

Gibt true zurück, wenn die Knotenliste other und diese Knotenliste gleich sind; andernfalls wird false zurückgegeben.

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