[TD]prevent frames on exported/printed page
This commit is contained in:
committed by
Yorik van Havre
parent
9ea576d725
commit
82193e3c9f
@@ -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)
|
||||
|
||||
@@ -185,6 +185,9 @@ public:
|
||||
|
||||
static bool hasSelectedChildren(QGIView* parent);
|
||||
|
||||
bool isExporting() const;
|
||||
|
||||
|
||||
protected:
|
||||
QGIView* getQGIVByName(std::string name) const;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -126,7 +126,6 @@ public:
|
||||
virtual double getLineWidth();
|
||||
virtual double getVertexSize();
|
||||
|
||||
bool isExporting() const;
|
||||
bool hideCenterMarks() const;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user