Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.14
-
None
Description
QDomElement root = document.firstChildElement (); QDomNodeList sections = root.elementsByTagName (XML_NODE_ROOT); QDomNodeList nodes; nodes = root.elementsByTagName (XML_NODE_PARAMETERS); for (int i=0; i<nodes.length (); i++) { const QDomNode node = nodes.at (i); for (int a=0; a<node.attributes ().length (); a++) { QDomNode attr = node.attributes ().item (a); qDebug () << attr.nodeName () << " " << attr.nodeType (); } }
I would have expected to be able to write the above code in C11 format like this...
nodes = root.elementsByTagName (XML_NODE_PARAMETERS); for (auto node : nodes) { for (auto attr : node.attributes ()) { qDebug () << attr.nodeName () << " " << attr.nodeType (); } }
But I get missing `QDomNodeList - no viale begin` on `nodes` and the same for `QDomNamedNodeMap` on `attr`.
Also there's a missing function for `at` in `QDomNode` making inconsistent with normal QT programming (you have to use `item` instead).