mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-03 02:30:52 +01:00
Use pugixml for parse local name of directory and element informations
This commit is contained in:
@@ -154,6 +154,21 @@ void DiagramContext::fromXml(const QDomElement &e, const QString &tag_name) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DiagramContext::fromXml
|
||||
* Read this context properties from the @dom_element, looking for tags named @tag_name
|
||||
* @param dom_element : dom element to parse
|
||||
* @param tag_name : tag name to find, by default "property"
|
||||
*/
|
||||
void DiagramContext::fromXml(const pugi::xml_node &dom_element, const QString &tag_name)
|
||||
{
|
||||
for(auto node = dom_element.child(tag_name.toStdString().c_str()) ; node ; node = node.next_sibling(tag_name.toStdString().c_str()))
|
||||
{
|
||||
addValue(node.attribute("name").as_string(), QVariant(node.text().as_string()));
|
||||
m_content_show.insert(node.attribute("name").as_string(), node.attribute("show").empty()? 1 : node.attribute("show").as_int());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Export this context properties to \a settings by creating an array named \a
|
||||
array_name.
|
||||
|
||||
Reference in New Issue
Block a user