I've got a QDomElement, and I would like to debug it, i.e. see it as plain text in debug console. In order to output it with qDebug(), it needs to be in QString format, however I don't see any conversion method from a QDomElement nor a QDomNode.
Any idea? Thanks!
There is no built-in operator for streaming DOM elements to QDebug. You could write one easily enough, something like:
QDebug operator<<(QDebug dbg, const QDomNode& node)
{
QString s;
QTextStream str(&s, QIODevice::WriteOnly);
node.save(str, 2);
dbg << qPrintable(s);
return dbg;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With