mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-03 02:30:52 +01:00
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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user