When parse the defintion of an element in the diagram editor, befor parse anything, we get every DomElement with tagg "input".

If no one of these "input" have the attribute "tagg" set to "label", we set it to the first "input"  


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5084 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-10-21 12:05:57 +00:00
parent 02fb84caec
commit 7e2134e0db

View File

@@ -164,6 +164,22 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) {
if (elmts.tagName() == "description")
{
//Minor workaround to find if there is a "input" tagg as label.
//If not, we set the tagg "label" to the first "input.
QList <QDomElement> input_field;
bool have_label = false;
for (QDomElement input_node = node.firstChildElement("input") ; !input_node.isNull() ; input_node = input_node.nextSiblingElement("input"))
{
if (!input_node.isNull())
{
input_field << input_node;
if (input_node.attribute("tagg", "none") == "label")
have_label = true;
}
}
if(!have_label && !input_field.isEmpty())
input_field.first().setAttribute("tagg", "label");
//Manage the graphic description = part of drawing
for (QDomNode n = node.firstChild() ; !n.isNull() ; n = n.nextSibling())
{