Auf dieser Seite

QDomNodeList Class

Die Klasse „QDomNodeList“ ist eine Liste von „ QDomNode “-Objekten. Mehr...

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

Hinweis: Alle Funktionen dieser Klasse sind reentrant.

Öffentliche Typen

(since 6.9) const_iterator
(since 6.9) const_pointer
(since 6.9) const_reference
(since 6.9) const_reverse_iterator
(since 6.9) difference_type
(since 6.9) pointer
(since 6.9) reference
(since 6.9) value_type

Öffentliche Funktionen

QDomNodeList()
QDomNodeList(const QDomNodeList &nodeList)
~QDomNodeList()
QDomNode at(int index) const
(since 6.9) QDomNodeList::const_iterator begin() const
(since 6.9) QDomNodeList::const_iterator cbegin() const
(since 6.9) QDomNodeList::const_iterator cend() const
(since 6.9) QDomNodeList::const_iterator constBegin() const
(since 6.9) QDomNodeList::const_iterator constEnd() const
int count() const
(since 6.9) QDomNodeList::const_reverse_iterator crbegin() const
(since 6.9) QDomNodeList::const_reverse_iterator crend() const
(since 6.9) QDomNodeList::const_iterator end() const
bool isEmpty() const
QDomNode item(int index) const
int length() const
(since 6.9) QDomNodeList::const_reverse_iterator rbegin() const
(since 6.9) QDomNodeList::const_reverse_iterator rend() const
int size() const
QDomNodeList &operator=(const QDomNodeList &other)
bool operator!=(const QDomNodeList &lhs, const QDomNodeList &rhs)
bool operator==(const QDomNodeList &lhs, const QDomNodeList &rhs)

Ausführliche Beschreibung

Listen können mit den Methoden „ QDomDocument::elementsByTagName()“ und „ QDomNode::childNodes()“ abgerufen werden. Das Document Object Model (DOM) verlangt, dass diese Listen „live“ sind: Sobald Sie das zugrunde liegende Dokument ändern, wird der Inhalt der Liste aktualisiert.

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

Weitere Informationen zum 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 zu „ QDomDocument “.

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

Dokumentation zu Mitgliedstypen

[alias, since 6.9] QDomNodeList::const_iterator

[alias, since 6.9] QDomNodeList::const_reverse_iterator

Typedefs für eine undurchsichtige Klasse, die einen bidirektionalen Iterator über eine ` QDomNodeList` implementiert.

Hinweis: „ QDomNodeList “ unterstützt keine In-Place-Änderungen an Knoten, daher gibt es keinen veränderbaren Iterator.

Diese Typdefinitionen wurden in Qt 6.9 eingeführt.

[alias, since 6.9] QDomNodeList::const_pointer

[alias, since 6.9] QDomNodeList::const_reference

[alias, since 6.9] QDomNodeList::difference_type

[alias, since 6.9] QDomNodeList::pointer

[alias, since 6.9] QDomNodeList::reference

[alias, since 6.9] QDomNodeList::value_type

Zur Gewährleistung der STL-Kompatibilität.

Hinweis: „ QDomNodeList “ unterstützt keine In-Place-Änderungen an Knoten, daher sind „reference“ und „ const_reference “ vom gleichen Typ, ebenso wie „pointer“ und „ const_pointer “.

Diese Typdefinitionen wurden in Qt 6.9 eingeführt.

Dokumentation zu den Mitgliedsfunktionen

QDomNodeList::QDomNodeList()

Erstellt eine leere Knotenliste.

QDomNodeList::QDomNodeList(const QDomNodeList &nodeList)

Erstellt eine Kopie von „ nodeList “.

[noexcept] QDomNodeList::~QDomNodeList()

Löscht das Objekt und gibt dessen Ressourcen frei.

QDomNode QDomNodeList::at(int index) const

Diese Funktion dient der Einheitlichkeit der Qt-API. Sie entspricht item().

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

[noexcept, since 6.9] QDomNodeList::const_iterator QDomNodeList::begin() const

[noexcept, since 6.9] QDomNodeList::const_iterator QDomNodeList::cbegin() const

[noexcept, since 6.9] QDomNodeList::const_iterator QDomNodeList::cend() const

[noexcept, since 6.9] QDomNodeList::const_iterator QDomNodeList::constBegin() const

[noexcept, since 6.9] QDomNodeList::const_iterator QDomNodeList::constEnd() const

[noexcept, since 6.9] QDomNodeList::const_iterator QDomNodeList::end() const

[noexcept, since 6.9] QDomNodeList::const_reverse_iterator QDomNodeList::crbegin() const

[noexcept, since 6.9] QDomNodeList::const_reverse_iterator QDomNodeList::crend() const

[noexcept, since 6.9] QDomNodeList::const_reverse_iterator QDomNodeList::rbegin() const

[noexcept, since 6.9] QDomNodeList::const_reverse_iterator QDomNodeList::rend() const

Gibt jeweils einen ` const_iterator ` oder einen ` const_reverse_iterator` zurück, der auf das erste bzw. auf das Element direkt nach dem letzten Element der Liste verweist.

Hinweis: „ QDomNodeList “ unterstützt keine Änderungen an Knoten an Ort und Stelle, daher gibt es keinen veränderbaren Iterator.

Diese Funktionen wurden in Qt 6.9 eingeführt.

int QDomNodeList::count() const

Diese Funktion dient der Konsistenz der Qt-API. Sie entspricht der Funktion „ length()“.

bool QDomNodeList::isEmpty() const

Gibt „ true “ zurück, wenn die Liste keine Elemente enthält; andernfalls wird „ false “ zurückgegeben. Diese Funktion dient der Konsistenz der Qt-API.

QDomNode QDomNodeList::item(int index) const

Gibt den Knoten an der Position index zurück.

Ist index negativ oder gilt index >= length(), so wird ein Null-Knoten zurückgegeben (d. h. ein Knoten, für den QDomNode::isNull() den Wert „true“ zurückgibt).

Siehe auch length().

int QDomNodeList::length() const

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

int QDomNodeList::size() const

Diese Funktion dient der Konsistenz der Qt-API. Sie entspricht der Funktion „ length()“.

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

Weist dieser Knotenliste „ other “ zu.

Zugehörige Nicht-Mitglieder

[noexcept] bool operator!=(const QDomNodeList &lhs, const QDomNodeList &rhs)

Gibt „ true “ zurück, wenn die Listen „ lhs “ und „ rhs “ des Knotens nicht identisch sind; andernfalls wird „ false “ zurückgegeben.

[noexcept] bool operator==(const QDomNodeList &lhs, const QDomNodeList &rhs)

Gibt „ true “ zurück, wenn die Listen „ lhs “ und „ rhs “ des Knotens identisch sind; andernfalls wird „ false “ zurückgegeben.

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