QDomElement root = doc.documentElement(); QDomNodeList children = root.childNodes(); for (int i = 0; i < children.size(); i++) { QDomElement child = children.at(i).toElement(); // Do something with the child element }
QDomElement element = // Some QDomElement object QDomNodeList children = element.childNodes(); int numChildren = children.size();In this example, we simply get the list of child nodes for a given element and then get the size of the list. Package/Library: Qt Core (qtcore)