[Interest] Line break when writing a XML file with QXmlStreamWriter

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Fri Oct 3 18:10:17 CEST 2014


Dear all,

I am writing large XML files with QXmlStreamWriter.
Some parts of the file contain large lists of numbers as text data. Even
with auto formatting on, the writer does not insert line breaks and it
results in huge lines, which are not very text-editor friendly.

I have tried writeCharacters("\n") but no newline is added, likely because
this is a special character.

How may I insert line breaks in the XML file?

May I safely write to the QIODevice directly? This would imply that
QXmlStreamWriter does not defer any write, as there is no method to flush
it. And it surely defers some times, as this is required for writing the
short XML syntax for empty tags.

Thanks,

Etienne.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141003/7da15753/attachment.html>


More information about the Interest mailing list