[TD]prevent frames on exported/printed page

This commit is contained in:
wandererfan
2025-12-15 19:15:20 -05:00
committed by Yorik van Havre
parent fa8e81f0d6
commit f64408de2e
4 changed files with 24 additions and 16 deletions

View File

@@ -1086,6 +1086,10 @@ void QGIView::updateFrameVisibility()
bool QGIView::shouldShowFrame() const
{
if (isExporting()) {
return false;
}
if (isSelected()) {
return true;
}
@@ -1119,6 +1123,23 @@ bool QGIView::shouldShowFromViewProvider() const
return vpPage->getFrameState();
}
bool QGIView::isExporting() const
{
auto* view{freecad_cast<TechDraw::DrawView*>(getViewObject())};
auto vpPage = getViewProviderPage(view);
if (!view || !vpPage) {
return false;
}
QGSPage* scenePage = vpPage->getQGSPage();
if (!scenePage) {
return false;
}
return scenePage->getExportingAny();
}
//! Retrieves objects of type T with given indexes
template <typename T>
std::vector<T> QGIView::getObjects(std::vector<int> indexes)

View File

@@ -185,6 +185,9 @@ public:
static bool hasSelectedChildren(QGIView* parent);
bool isExporting() const;
protected:
QGIView* getQGIVByName(std::string name) const;

View File

@@ -1339,21 +1339,6 @@ void QGIViewPart::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
}
bool QGIViewPart::isExporting() const
{
// dvp already validated
auto viewPart {freecad_cast<TechDraw::DrawViewPart*>(getViewObject())};
auto vpPage = getViewProviderPage(viewPart);
QGSPage* scenePage = vpPage->getQGSPage();
if (!scenePage) {
return false;
}
return scenePage->getExportingAny();
}
// returns true if vertex dots should be shown
// note this is only one of the "rules" around showing or hiding vertices.
bool QGIViewPart::showVertices() const

View File

@@ -126,7 +126,6 @@ public:
virtual double getLineWidth();
virtual double getVertexSize();
bool isExporting() const;
bool hideCenterMarks() const;