mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
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:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user