Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QDomNode QDomNode::appendChild ( const QDomNode newChild  )  [inherited]

Appends newChild as the node's last child.

If newChild is the child of another node, it is reparented to this node. If newChild is a child of this node, then its position in the list of children is changed.

If newChild is a QDomDocumentFragment, then the children of the fragment are removed from the fragment and appended.

If newChild is a QDomElement and this node is a QDomDocument that already has an element node as a child, newChild is not added as a child and a null node is returned.

Calling this function on a null node(created, for example, with the default constructor) does nothing.

The DOM specification disallow inserting attribute nodes, but due to historical reasons QDom accept them nevertheless.

See also:
insertBefore() insertAfter() replaceChild() removeChild()

Definition at line 2610 of file qdom.cpp.

References QDomNode::impl, and QDomNode::QDomNode().

Referenced by QDomImplementation::createDocument(), and QAbstractFormBuilder::save().

    if (!impl) {
        qWarning("Calling appendChild() on a null node does nothing.");
        return QDomNode();
    return QDomNode(IMPL->appendChild(newChild.impl));

Generated by  Doxygen 1.6.0   Back to index