diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 8b43bcb04..465ec7716 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1052,6 +1052,18 @@ void VAbstractPattern::haveLiteChange() emit patternChanged(false); } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::NeedFullParsing() +{ + emit UndoCommand(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::ClearScene() +{ + emit ClearMainWindow(); +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::ToolExists(const quint32 &id) const { diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index a6b7e7ab1..1788c8ca9 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -253,6 +253,8 @@ signals: public slots: virtual void LiteParseTree(const Document &parse)=0; void haveLiteChange(); + void NeedFullParsing(); + void ClearScene(); protected: /** @brief nameActivDraw name current pattern peace. */ diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index b4f212b58..7e1c32dab 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -143,8 +143,8 @@ void VToolBasePoint::AddToFile() patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails)); AddPatternPiece *addPP = new AddPatternPiece(patternPiece, doc, namePP); - connect(addPP, &AddPatternPiece::ClearScene, [this](){emit doc->ClearMainWindow();}); - connect(addPP, &AddPatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();}); + connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene); + connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addPP); } @@ -233,7 +233,7 @@ void VToolBasePoint::DeleteTool(bool ask) qCDebug(vTool, "Begin deleting."); DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw); - connect(deletePP, &DeletePatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();}); + connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(deletePP); // Throw exception, this will help prevent case when we forget to immediately quit function. diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.cpp b/src/libs/vtools/tools/drawTools/vdrawtool.cpp index c88ffbcfe..81bbfb172 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.cpp +++ b/src/libs/vtools/tools/drawTools/vdrawtool.cpp @@ -372,7 +372,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine void VDrawTool::AddToCalculation(const QDomElement &domElement) { AddToCalc *addToCal = new AddToCalc(domElement, doc); - connect(addToCal, &AddToCalc::NeedFullParsing, [this](){emit doc->UndoCommand();}); + connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addToCal); } diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index 150a900f0..ad74b4cf4 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -88,7 +88,7 @@ void VAbstractTool::DeleteTool(bool ask) qCDebug(vTool, "Begin deleting."); DelTool *delTool = new DelTool(doc, id); - connect(delTool, &DelTool::NeedFullParsing, [this](){emit doc->UndoCommand();}); + connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(delTool); // Throw exception, this will help prevent case when we forget to immediately quit function. diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index 2d8041193..9eed8d8c3 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -331,7 +331,7 @@ void VToolDetail::AddToFile() } AddDet *addDet = new AddDet(domElement, doc, detail, drawName); - connect(addDet, &AddDet::NeedFullParsing, [this](){emit doc->UndoCommand();}); + connect(addDet, &AddDet::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addDet); } @@ -680,7 +680,7 @@ void VToolDetail::DeleteTool(bool ask) return; } /* If UnionDetails tool delete detail no need emit FullParsing.*/ - connect(delDet, &DeleteDetail::NeedFullParsing, [this](){emit doc->UndoCommand();}); + connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); } qApp->getUndoStack()->push(delDet);