Merge pull request #4773 from steelman/techdraw-svg-layer

[TD] Make the root SVG group a layer for Inkscape
This commit is contained in:
Yorik van Havre
2021-05-11 12:15:14 +02:00
committed by GitHub

View File

@@ -114,6 +114,7 @@
#define CC_NS_URI "http://creativecommons.org/ns#"
#define DC_NS_URI "http://purl.org/dc/elements/1.1/"
#define RDF_NS_URI "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
#define INKSCAPE_NS_URI "http://www.inkscape.org/namespaces/inkscape"
using namespace Gui;
using namespace TechDraw;
@@ -899,10 +900,16 @@ void QGVPage::postProcessXml(QTemporaryFile& temporaryFile, QString fileName, QS
QString::fromUtf8(DC_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:rdf"),
QString::fromUtf8(RDF_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:inkscape"),
QString::fromUtf8(INKSCAPE_NS_URI));
// Create the root group which will host the drawing group and the template group
QDomElement rootGroup = exportDoc.createElement(QString::fromUtf8("g"));
rootGroup.setAttribute(QString::fromUtf8("id"), pageName);
rootGroup.setAttribute(QString::fromUtf8("inkscape:groupmode"),
QString::fromUtf8("layer"));
rootGroup.setAttribute(QString::fromUtf8("inkscape:label"),
QString::fromUtf8("TechDraw"));
// Now insert our template
QGISVGTemplate *svgTemplate = dynamic_cast<QGISVGTemplate *>(pageTemplate);