QDomNode Swap
General and Desktop
3
Posts
3
Posters
757
Views
1
Watching
-
Hi
How can I swap two nodes in a QDomDocument (xml) ? -
Hi
How can I swap two nodes in a QDomDocument (xml) ?As
QDomDocumentdoesn'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