QDomNodeList 類

The QDomNodeList 類是列錶化的 QDomNode 對象。 更多...

頭: #include <QDomNodeList>
qmake: QT += xml

注意: 此類的所有函數 可重入 .

公共函數

QDomNodeList ()
QDomNodeList (const QDomNodeList & n )
~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 & n ) const
QDomNodeList & operator= (const QDomNodeList & n )
bool operator== (const QDomNodeList & n ) const

詳細描述

The QDomNodeList 類是列錶化的 QDomNode 對象。

列錶的獲得可以通過 QDomDocument::elementsByTagName () 和 QDomNode::childNodes ()。DOM (文檔對象模型) 要求這些列錶是 "實時" 的:每當改變底層文檔時,會更新列錶內容。

可以從列錶獲取特定節點采用 item ()。列錶項數的返迴是通過 length ().

有關文檔對象模型的進一步信息,見 級彆 1 and 級彆 2 核心 。有關 DOM 實現的更一般介紹,見 QDomDocument 文檔編製。

另請參閱 QDomNode::childNodes () 和 QDomDocument::elementsByTagName ().

成員函數文檔編製

QDomNodeList:: QDomNodeList ()

創建空節點列錶。

QDomNodeList:: QDomNodeList (const QDomNodeList & n )

構造副本為 n .

QDomNodeList:: ~QDomNodeList ()

銷毀對象並釋放其資源。

QDomNode QDomNodeList:: at ( int index ) const

提供此函數是為 Qt API 一緻性。它相當於 item ().

index 為負或者若 index >= length () 則返迴 null 節點 (即:節點的 QDomNode::isNull () 返迴 true)。

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 ().

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

返迴 true 節點列錶 n 和此節點列錶不相等;否則返迴 false .

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

賦值 n 到此節點列錶。

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

返迴 true 若節點列錶 n 和此節點列錶相等;否則返迴 false .