forked from qt-creator/qt-creator
SCXML Editor: fix behavior of else and elseif tags
SCXML specify that the <if> tag contains elements separated by tags <else/> and <elseif/>. The SCXML Editor used to nest instruction inside the <else/> and <elseif/> tags. This patch implement the correct behavior, so each new inserted element is appended inside the wrapping <if>. Note that the new elements are always inserted as last child of <if>. Task-number: QTCREATORBUG-17674 Change-Id: I327941bbbd8b0cc04b0c26553257ccb2a24c8306 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This commit is contained in:
@@ -414,6 +414,15 @@ ScxmlTag *addChild(ScxmlTag *tag, const QVariantMap &data, GraphicsScene *scene)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ScxmlTag *addSibling(ScxmlTag *tag, const QVariantMap &data, GraphicsScene *scene)
|
||||
{
|
||||
TagType newTagType = (TagType)data.value(Constants::C_SCXMLTAG_TAGTYPE, 0).toInt();
|
||||
if (newTagType >= UnknownTag) {
|
||||
return addNewTag(tag->parentTag(), newTagType, scene);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace SceneUtils
|
||||
} // namespace PluginInterface
|
||||
} // namespace ScxmlEditor
|
||||
|
||||
Reference in New Issue
Block a user