Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QString XML_reader::get_image_path() {
- QDomElement element = document.documentElement();
- QDomNode node = element.firstChildElement();
- QString image_path;
- while (!node.isNull()) {
- if (node.isElement()) {
- QDomNode n = node.toElement().firstChildElement();
- while (!n.isNull()) {
- if (n.isElement()) {
- QDomElement el = n.toElement();
- if (el.tagName() == "photo") {
- QDomNode nd = n.toElement().firstChildElement();
- while(!nd.isNull()) {
- QDomElement elm = nd.toElement();
- if (elm.tagName() == "image-path") {
- image_path = el.text();
- break;
- }
- }
- nd = nd.nextSibling();
- }
- }
- n = n.nextSibling();
- }
- }
- node = node.nextSibling();
- }
- return image_path;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement