このページでは

QDomNodeList Class

QDomNodeList クラスは、QDomNode オブジェクトのリストです。詳細...

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

注:このクラスのすべての関数は再入可能である。

パブリック型

(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

パブリック関数

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)

詳細な説明

リストは、QDomDocument::elementsByTagName() およびQDomNode::childNodes() によって取得できます。Document Object Model (DOM) では、これらのリストは「ライブ」であることが求められます。つまり、基になるドキュメントを変更するたびに、リストの内容が更新されます。

item() を使用すると、リストから特定のノードを取得できます。リスト内の項目数は、length() によって返されます。

Document Object Model の詳細については、Level 1およびLevel 2 Core を参照してください。DOM の実装に関するより一般的な概要については、QDomDocument のドキュメントを参照してください。

QDomNode::childNodes() およびQDomDocument::elementsByTagName()も参照してください 。

メンバ型のドキュメント

[alias, since 6.9] QDomNodeList::const_iterator

[alias, since 6.9] QDomNodeList::const_reverse_iterator

QDomNodeList 上の双方向イテレータを実装する不透明クラスに対する typedef です。

注: QDomNodeList は ノードのインプレース変更をサポートしていないため、可変イテレータは存在しません。

これらのtypedefは、Qt 6.9で導入されました。

[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

STLとの互換性を確保するために用意されています。

注: QDomNodeList は ノードのインプレース変更をサポートしていないため、referenceとconst_reference は同じ型であり、同様にpointerとconst_pointer も同一の型となります。

これらのtypedefはQt 6.9で導入されました。

メンバ関数のドキュメント

QDomNodeList::QDomNodeList()

空のノードリストを作成します。

QDomNodeList::QDomNodeList(const QDomNodeList &nodeList)

nodeList のコピーを作成します。

[noexcept] QDomNodeList::~QDomNodeList()

オブジェクトを破棄し、そのリソースを解放します。

QDomNode QDomNodeList::at(int index) const

この関数は、Qt API の一貫性を保つために提供されています。これは、item() と同等です。

index が負の値である場合、またはindex >=length()である場合、nullノードが返されます(つまり、QDomNode::isNull()がtrueを返すノード)。

[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

それぞれ、リストの先頭要素、またはリストの最後の要素の次の要素を指すconst_iterator またはconst_reverse_iterator を返します。

注: QDomNodeList は ノードのインプレース変更をサポートしていないため、可変イテレータは存在しません。

これらの関数は Qt 6.9 で導入されました。

int QDomNodeList::count() const

この関数は、Qt APIの一貫性を保つために用意されています。これは、length() と同等です。

bool QDomNodeList::isEmpty() const

リストに要素が含まれていない場合は `true ` を返し、それ以外の場合は `false` を返します。この関数は、Qt API の一貫性を保つために用意されています。

QDomNode QDomNodeList::item(int index) const

位置index にあるノードを返します。

index が負の値である場合、またはindex >=length()である場合は、nullノードが返されます(つまり、QDomNode::isNull()がtrueを返すノード)。

length()も参照してください 。

int QDomNodeList::length() const

リスト内のノード数を返します。

int QDomNodeList::size() const

この関数は、Qt APIの一貫性を保つために用意されています。これは、length() と同等です。

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

このノードリストにother を割り当てます。

関連する非メンバー

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

ノードのリスト `lhs ` と `rhs ` が等しくない場合は `true ` を返し、それ以外の場合は `false` を返します。

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

ノードのリスト `lhs ` と `rhs ` が等しい場合は `true ` を返し、そうでない場合は `false` を返します。

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