Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84347

QDom insistent with other QT array

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.14
    • XML: DOM
    • None
    • All

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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            chrisemsen Chris Emsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes