How can I write this to an xml file using qt?
<model>
<column loop="true">`enter code here`
<item2 color="#4d6862" />
<item2 color="#ff0000ff" />
<item2 color="#ff00ff00" />
<item2 color="#ff00ffff" />
<item2 color="#ffff0000" />
<item2 color="#ffff00ff" />
<item2 color="#ffffff00" />
<item2 color="#4d6862" />
</column>
</model>
This looks promising ( Writing XML Nodes in QtXML (QDomElement) ) but it doesn't mention attributes.
You can do it with
QXmlStreamWriter
: http://qt-project.org/doc/qt-5/qxmlstreamwriter.html