QDomNode Swap
-
Hi
How can I swap two nodes in a QDomDocument (xml) ? -
As
QDomDocument
doesn't provide aswap()
method itself you might just do it the oldschool way (untested):QDomDocument a, b; // Swap QDomDocuments { QDomDocument tmp(a); a = b; b = tmp; } This works because `QDomDocument` implements the `operator=`. There are also other ways and maybe somebody has a better solution. Maybe you can even use `std::swap`.
-
hi
If you have a pointer to both QDomNode, you can use
http://doc.qt.io/qt-5/qdomnode.html#replaceChild