| 43 | } |
| 44 | |
| 45 | std::pair<QString, QStringPairList> |
| 46 | YUViewDomElement::findChildValueWithAttributes(const QString &tagName) const |
| 47 | { |
| 48 | for (auto n = firstChild(); !n.isNull(); n = n.nextSibling()) |
| 49 | { |
| 50 | if (n.isElement() && n.toElement().tagName() == tagName) |
| 51 | { |
| 52 | QStringPairList attributeList; |
| 53 | auto attributes = n.toElement().attributes(); |
| 54 | for (int i = 0; i < attributes.length(); i++) |
| 55 | { |
| 56 | auto name = attributes.item(i).nodeName(); |
| 57 | auto val = attributes.item(i).nodeValue(); |
| 58 | attributeList.append(QStringPair(name, val)); |
| 59 | } |
| 60 | auto text = n.toElement().text(); |
| 61 | return {text, attributeList}; |
| 62 | } |
| 63 | } |
| 64 | return {}; |
| 65 | } |
| 66 | |
| 67 | int YUViewDomElement::findChildValueInt(const QString &tagName, int defaultValue) const |
| 68 | { |
no test coverage detected