diff --git a/src/app/tape/dialogs/dialogabouttape.cpp b/src/app/tape/dialogs/dialogabouttape.cpp index 5c282bd9b..b3f45edd9 100644 --- a/src/app/tape/dialogs/dialogabouttape.cpp +++ b/src/app/tape/dialogs/dialogabouttape.cpp @@ -50,7 +50,8 @@ DialogAboutTape::DialogAboutTape(QWidget *parent) //mApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); RetranslateUi(); - connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this](){ + connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]() + { if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false) { qWarning() << tr("Cannot open your default browser"); diff --git a/src/app/valentina/dialogs/dialogaboutapp.cpp b/src/app/valentina/dialogs/dialogaboutapp.cpp index 3379cafb3..e0cdeca31 100644 --- a/src/app/valentina/dialogs/dialogaboutapp.cpp +++ b/src/app/valentina/dialogs/dialogaboutapp.cpp @@ -61,7 +61,8 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) : ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR)); - connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this](){ + connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]() + { if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false) { qWarning() << tr("Cannot open your default browser"); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 7235ac556..cb16125a6 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -140,7 +140,8 @@ MainWindow::MainWindow(QWidget *parent) connect(doc, &VPattern::patternChanged, this, &MainWindow::PatternChangesWereSaved); connect(doc, &VPattern::UndoCommand, this, &MainWindow::FullParseFile); connect(doc, &VPattern::SetEnabledGUI, this, &MainWindow::SetEnabledGUI); - connect(doc, &VPattern::CheckLayout, [this](){ + connect(doc, &VPattern::CheckLayout, [this]() + { if (pattern->DataDetails()->count() == 0) { if(not ui->actionDraw->isChecked()) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 1dedb2bb1..74f8fcce2 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1157,6 +1157,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 7c8cfad3f..abf36122c 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -281,6 +281,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 5d5429acf..f91af956d 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -387,7 +387,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); } @@ -1084,7 +1084,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);