I have the following code:
element.clear();
element.setTagName("accountpoint");
element.setAttribute("code", QString(ID_CONST)+serial);
element.setAttribute("name", QString());
element.setAttribute("serial", serial);
QFile file(filename);
file.open(QIODevice::ReadWrite);
QTextStream stream(&file);
doc.save(stream, 4);
I thought we get the XML as:
<accountpoint code="4871583314750580" name="" serial="14750580">
But I have:
<accountpoint serial="14750580" code="4871583314750580" name="">
Why?
PS Yes, of course, this does not matter in the XML document, but I want to get the correct order of the attributes.
source
share