! * Read an XML attribute and convert it to int * \param name attribute name * \param ok pointer to report back whether the attribute value could be determined (may be NULL) * \return the attribute value if found and converted, otherwise zero (in this case *ok is false) */
| 167 | * \return the attribute value if found and converted, otherwise zero (in this case *ok is false) |
| 168 | */ |
| 169 | int XmlStreamReader::readAttributeInt(const QString& name, bool* ok) { |
| 170 | QString str = attributes().value(namespaceUri().toString(), name).toString(); |
| 171 | if (str.isEmpty()) { |
| 172 | if (ok) |
| 173 | *ok = false; |
| 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | return str.toInt(ok); |
| 178 | } |
no test coverage detected