[TD]fix Svg hatch on export
This commit is contained in:
@@ -743,8 +743,8 @@ void QGVPage::refreshViews(void)
|
||||
QList<QGraphicsItem*> qgiv;
|
||||
//find only QGIV's
|
||||
for (auto q: list) {
|
||||
QString tileFamily = QString::fromUtf8("QGIV");
|
||||
if (tileFamily == q->data(0).toString()) {
|
||||
QString viewFamily = QString::fromUtf8("QGIV");
|
||||
if (viewFamily == q->data(0).toString()) {
|
||||
qgiv.push_back(q);
|
||||
}
|
||||
}
|
||||
@@ -756,19 +756,14 @@ void QGVPage::refreshViews(void)
|
||||
}
|
||||
}
|
||||
|
||||
void QGVPage::toggleHatch(bool enable)
|
||||
void QGVPage::setExporting(bool enable)
|
||||
{
|
||||
// Base::Console().Message("QGVP::setExporting(%d)\n", enable);
|
||||
QList<QGraphicsItem*> sceneItems = scene()->items();
|
||||
for (auto& qgi:sceneItems) {
|
||||
QGIViewPart* qgiPart = dynamic_cast<QGIViewPart *>(qgi);
|
||||
if(qgiPart) {
|
||||
QList<QGraphicsItem*> partChildren = qgiPart->childItems();
|
||||
int faceItemType = QGraphicsItem::UserType + 104;
|
||||
for (auto& c:partChildren) {
|
||||
if (c->type() == faceItemType) {
|
||||
static_cast<QGIFace*>(c)->toggleSvg(enable);
|
||||
}
|
||||
}
|
||||
qgiPart->setExporting(enable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -810,7 +805,7 @@ void QGVPage::saveSvg(QString filename)
|
||||
bool saveState = m_vpPage->getFrameState();
|
||||
m_vpPage->setFrameState(false);
|
||||
m_vpPage->setTemplateMarkers(false);
|
||||
toggleHatch(false);
|
||||
setExporting(true);
|
||||
|
||||
// Here we temporarily hide the page template, because Qt would otherwise convert the SVG template
|
||||
// texts into series of paths, making the later document edits practically unfeasible.
|
||||
@@ -839,7 +834,7 @@ void QGVPage::saveSvg(QString filename)
|
||||
|
||||
m_vpPage->setFrameState(saveState);
|
||||
m_vpPage->setTemplateMarkers(saveState);
|
||||
toggleHatch(true);
|
||||
setExporting(false);
|
||||
if (templateVisible) {
|
||||
svgTemplate->show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user