View does not appear on Redo
Crash in Page on Redo View
This commit is contained in:
@@ -195,7 +195,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
|
||||
//TODO: if MeasureType = Projected and the Projected shape changes, the Dimension may become invalid (see tilted Cube example)
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
return App::DocumentObject::execute();;
|
||||
}
|
||||
|
||||
std::string DrawViewDimension::getFormatedValue() const
|
||||
|
||||
@@ -114,7 +114,7 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0)
|
||||
//ADD_PROPERTY_TYPE(ShowIsoLines ,(false),group,App::Prop_None,"Iso u,v lines on/off");
|
||||
ADD_PROPERTY_TYPE(LineWidth,(0.7f),vgroup,App::Prop_None,"The thickness of visible lines");
|
||||
ADD_PROPERTY_TYPE(HiddenWidth,(0.15),vgroup,App::Prop_None,"The thickness of hidden lines, if enabled");
|
||||
ADD_PROPERTY_TYPE(Tolerance,(0.05f),vgroup,App::Prop_None,"The tessellation tolerance");
|
||||
ADD_PROPERTY_TYPE(Tolerance,(0.05f),vgroup,App::Prop_None,"The tessellation tolerance"); //tessellation?
|
||||
Tolerance.setConstraints(&floatRange);
|
||||
ADD_PROPERTY_TYPE(XAxisDirection ,(1,0,0) ,group,App::Prop_None,"Direction to use as X-axis in projection");
|
||||
|
||||
@@ -189,6 +189,7 @@ short DrawViewPart::mustExecute() const
|
||||
ShowSmoothLines.isTouched() ||
|
||||
ShowSeamLines.isTouched() ||
|
||||
LineWidth.isTouched() ||
|
||||
Tolerance.isTouched() ||
|
||||
HiddenWidth.isTouched());
|
||||
return result;
|
||||
}
|
||||
@@ -203,7 +204,7 @@ void DrawViewPart::onChanged(const App::Property* prop)
|
||||
prop == &ScaleType ||
|
||||
prop == &ShowHiddenLines ||
|
||||
prop == &ShowSmoothLines ||
|
||||
prop == &ShowSeamLines ||
|
||||
prop == &ShowSeamLines ||
|
||||
prop == &LineWidth ||
|
||||
prop == &HiddenWidth ) {
|
||||
try {
|
||||
|
||||
@@ -103,7 +103,7 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget*
|
||||
m_exportSVGAction = new QAction(tr("&Export SVG"), this);
|
||||
connect(m_exportSVGAction, SIGNAL(triggered()), this, SLOT(saveSVG()));
|
||||
|
||||
//m_outlineAction is obs? never set to Enabled?
|
||||
//m_outlineAction is obs? never set to Enabled?
|
||||
m_outlineAction = new QAction(tr("&Outline"), this);
|
||||
m_outlineAction->setEnabled(false);
|
||||
m_outlineAction->setCheckable(true);
|
||||
@@ -1080,6 +1080,14 @@ void MDIViewPage::selectionChanged()
|
||||
continue;
|
||||
|
||||
TechDraw::DrawView *dimObj = dimItem->getViewObject();
|
||||
if (!dimObj) {
|
||||
continue;
|
||||
}
|
||||
const char* name = dimObj->getNameInDocument();
|
||||
if (!name) { //can happen during undo/redo if Dim is selected???
|
||||
//Base::Console().Log("INFO - MDIVP::selectionChanged - dimObj name is null!\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
//bool accepted =
|
||||
static_cast<void> (Gui::Selection().addSelection(dimObj->getDocument()->getName(),dimObj->getNameInDocument()));
|
||||
|
||||
@@ -123,8 +123,12 @@ void QGIViewPart::tidy()
|
||||
|
||||
void QGIViewPart::setViewPartFeature(TechDraw::DrawViewPart *obj)
|
||||
{
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
// called from QGVPage
|
||||
setViewFeature(static_cast<TechDraw::DrawView *>(obj));
|
||||
draw();
|
||||
}
|
||||
|
||||
QPainterPath QGIViewPart::drawPainterPath(TechDrawGeometry::BaseGeom *baseGeom) const
|
||||
@@ -280,6 +284,8 @@ void QGIViewPart::updateView(bool update)
|
||||
}
|
||||
}
|
||||
draw();
|
||||
} else {
|
||||
QGIView::draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,11 @@ void QGVPage::drawBackground(QPainter *p, const QRectF &)
|
||||
if(!drawBkg)
|
||||
return;
|
||||
|
||||
if (!pageGui->getPageObject()) {
|
||||
//Base::Console().Log("TROUBLE - QGVP::drawBackground - no Page Object!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
p->save();
|
||||
p->resetTransform();
|
||||
|
||||
|
||||
@@ -337,5 +337,10 @@ void ViewProviderPage::finishRestoring()
|
||||
|
||||
TechDraw::DrawPage* ViewProviderPage::getPageObject() const
|
||||
{
|
||||
//during redo, pcObject can become invalid, but non-zero??
|
||||
if (!pcObject) {
|
||||
Base::Console().Message("TROUBLE - VPP::getPageObject - no Page Object!\n");
|
||||
return nullptr;
|
||||
}
|
||||
return dynamic_cast<TechDraw::DrawPage*>(pcObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user