Implemented drag'n drop of title block templates to diagrams + automatic integration in the parent project

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1471 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-01-22 10:40:37 +00:00
parent 1ef2a0421a
commit 4795ed206d
10 changed files with 560 additions and 15 deletions

View File

@@ -202,7 +202,7 @@ QDomElement TitleBlockTemplatesProjectCollection::getTemplateXmlDescription(cons
*/
bool TitleBlockTemplatesProjectCollection::setTemplateXmlDescription(const QString &template_name, const QDomElement &xml_elmt) {
// check basic stuff
if (xml_elmt.tagName() != "titleblocktemplate" || xml_elmt.attribute("name") != template_name) {
if (xml_elmt.tagName() != "titleblocktemplate") {
return(false);
}
@@ -212,6 +212,9 @@ bool TitleBlockTemplatesProjectCollection::setTemplateXmlDescription(const QStri
// we import the provided XML element in the project document
QDomElement import = xml_document_.importNode(xml_elmt, true).toElement();
// ensure the name stored in the XML description remains consistent with the provided template name
import.setAttribute("name", template_name);
// we either replace the previous description
if (titleblock_templates_xml_.contains(template_name)) {
QDomElement old_description = titleblock_templates_xml_[template_name];