8 QString nodeAttribute(QDomNode node, QString route, QString defaultval);
9 bool nodeAttributeBoolean(QDomNode node, QString route,
bool defaultval,
bool* formatok = NULL);
21 template <
typename Type>
22 Type nodeAttributeNumber(QDomNode node, QString route, Type defaultval,
bool negativesallowed,
bool* formatok)
25 bool formatok_internal;
27 QString attvalue = nodeAttribute(node, route, QString::number(defaultval));
29 if(attvalue.endsWith(
'%'))
32 retval = attvalue.toDouble(&formatok_internal);
34 if(!formatok_internal)
38 *formatok = formatok_internal;
40 if(!negativesallowed && retval < 0.0)
47 return static_cast<Type
>(retval);
50 #endif // XMLUTILS_HPP