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

QXmlStreamWriter, comments, broken autoindent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • 4.6.0
    • 4.5.3
    • None

      i am using QXmlStreamWriter to write xml. autoindentification is enabled, and result is good if i don't use comment

       writeStartElement("root");
      writeTextElement("element1","any text");
      writeTextElement("element2","any text");
      writeEndElement();
      
      <root>
           <element1>any text</element1>
           <element2>any text</element2>
      </root>
      

      when i write comment it doesn't put new line after it, so next element is on line just behind the comment

       writeStartElement("root");
      writeTextElement("element1","any text");
      writeComment("comment");
      writeTextElement("element2","any text");
      writeEndElement();
      
      <root>
           <element1>any text</element1>
           <!--comment--><element2>any text</element2>
      </root>
      

      expected behaviour would be to have aligning working after comment too
      what i want to achieve is this:

       <root>
      &nbsp<element1>any text</element1>
           <!--comment-->
           <element2>any text</element2>
      </root>
      

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

            phartman Peter Hartmann (closed Nokia identity) (Inactive)
            selmi Michal Seliga
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes