QDomNodeList 类

QDomNodeList class is a list of 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

详细描述

QDomNodeList class is a list of QDomNode 对象。

Lists can be obtained by QDomDocument::elementsByTagName () 和 QDomNode::childNodes (). The Document Object Model (DOM) requires these lists to be "live": whenever you change the underlying document, the contents of the list will get updated.

You can get a particular node from the list with item (). The number of items in the list is returned by length ().

有关文档对象模型的进一步信息,见 级别 1 and 级别 2 核心 。有关 DOM 实现的更一般介绍,见 QDomDocument 文档编制。

另请参阅 QDomNode::childNodes () 和 QDomDocument::elementsByTagName ().

成员函数文档编制

QDomNodeList:: QDomNodeList ()

Creates an empty node list.

QDomNodeList:: QDomNodeList (const QDomNodeList & n )

构造副本为 n .

QDomNodeList:: ~QDomNodeList ()

销毁对象并释放其资源。

QDomNode QDomNodeList:: at ( int index ) const

提供此函数是为 Qt API 一致性。它相当于 item ().

index 为负或者若 index >= length () then a null node is returned (i.e. a node for which QDomNode::isNull () returns true).

int QDomNodeList:: count () const

提供此函数是为 Qt API 一致性。它相当于 length ().

bool QDomNodeList:: isEmpty () const

返回 true if the list contains no items; otherwise returns false . This function is provided for Qt API consistency.

QDomNode QDomNodeList:: item ( int index ) const

返回节点在位置 index .

index 为负或者若 index >= length () then a null node is returned (i.e. a node for which QDomNode::isNull () returns true).

另请参阅 length ().

int QDomNodeList:: length () const

返回列表节点数。

int QDomNodeList:: size () const

提供此函数是为 Qt API 一致性。它相当于 length ().

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

返回 true the node list n and this node list are not equal; otherwise returns false .

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

赋值 n to this node list.

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

返回 true if the node list n and this node list are equal; otherwise returns false .