Here is an example straight from QDomDocument docs (detailed description part):
doc.appendChild(root);
root.appendChild(tag);
QDomText t
= doc.
createTextNode("Hello World");
tag.appendChild(t);
QDomDocument doc("MyML");
QDomElement root = doc.createElement("MyML");
doc.appendChild(root);
QDomElement tag = doc.createElement("Greeting");
root.appendChild(tag);
QDomText t = doc.createTextNode("Hello World");
tag.appendChild(t);
QString xml = doc.toString();
To copy to clipboard, switch view to plain text mode
You cannot do it like this:
element.appendChild(child);
QDomElement element;
element.appendChild(child);
To copy to clipboard, switch view to plain text mode
because the element exists no where. This is exactly what you do with "Configuration.VideoDevices". Use the QDomDocument::createElement() or its friends to construct elements.
Bookmarks