QDomNode is an interface class that represents a node in the XML document object model. The isText method of the QDomNode class returns true if the node contains only text and false otherwise.
Code Examples: 1. Checking if a QDomNode is a text node:
QDomDocument doc; QDomElement root = doc.createElement("root"); QDomText text = doc.createTextNode("hello world"); root.appendChild(text); if(text.isText()){ qDebug() << "This is a text node!"; }
2. Printing the text contents of a QDomNode if it is a text node:
QDomDocument doc; QDomElement root = doc.createElement("root"); QDomText text = doc.createTextNode("hello world"); root.appendChild(text); if(text.isText()){ qDebug() << "The text contents of this node are: " << text.nodeValue(); }
Package Library: Qt Core Library. QDomNode is part of the Qt XML module, which is included in the Qt Core Library.
C++ (Cpp) QDomNode::isText - 30 examples found. These are the top rated real world C++ (Cpp) examples of QDomNode::isText extracted from open source projects. You can rate examples to help us improve the quality of examples.