modernize C++: avoid bind

In many cases std::bind() is kept because the code is much simpler
This commit is contained in:
wmayer
2023-08-08 19:10:49 +02:00
committed by wwmayer
parent c765d64891
commit 948cbfccd9
80 changed files with 240 additions and 30 deletions

View File

@@ -152,6 +152,7 @@ SketchObject::SketchObject()
noRecomputes = false;
//NOLINTBEGIN
ExpressionEngine.setValidator(
std::bind(&Sketcher::SketchObject::validateExpression, this, sp::_1, sp::_2));
@@ -159,6 +160,7 @@ SketchObject::SketchObject()
std::bind(&Sketcher::SketchObject::constraintsRemoved, this, sp::_1));
constraintsRenamedConn = Constraints.signalConstraintsRenamed.connect(
std::bind(&Sketcher::SketchObject::constraintsRenamed, this, sp::_1));
//NOLINTEND
analyser = new SketchAnalysis(this);

View File

@@ -944,8 +944,10 @@ TaskSketcherConstraints::TaskSketcherConstraints(ViewProviderSketch* sketchView)
this,
&TaskSketcherConstraints::onFilterListItemChanged);
//NOLINTBEGIN
connectionConstraintsChanged = sketchView->signalConstraintsChanged.connect(
std::bind(&SketcherGui::TaskSketcherConstraints::slotConstraintsChanged, this));
//NOLINTEND
this->groupLayout()->addWidget(proxy);
@@ -953,9 +955,11 @@ TaskSketcherConstraints::TaskSketcherConstraints(ViewProviderSketch* sketchView)
ui->listWidgetConstraints->setStyleSheet(QString::fromLatin1("margin-top: 0px"));
//NOLINTBEGIN
Gui::Application* app = Gui::Application::Instance;
changedSketchView = app->signalChangedObject.connect(
std::bind(&TaskSketcherConstraints::onChangedSketchView, this, sp::_1, sp::_2));
//NOLINTEND
slotConstraintsChanged();// Populate constraints list
// Initialize special filters

View File

@@ -1070,8 +1070,10 @@ void TaskSketcherElements::connectSignals()
QObject::connect(
ui->filterButton, &QToolButton::clicked, ui->filterButton, &QToolButton::showMenu);
//NOLINTBEGIN
connectionElementsChanged = sketchView->signalElementsChanged.connect(
std::bind(&SketcherGui::TaskSketcherElements::slotElementsChanged, this));
//NOLINTEND
}
/* filter functions --------------------------------------------------- */

View File

@@ -52,8 +52,10 @@ TaskSketcherMessages::TaskSketcherMessages(ViewProviderSketch* sketchView)
this->groupLayout()->addWidget(proxy);
//NOLINTBEGIN
connectionSetUp = sketchView->signalSetUp.connect(std::bind(
&SketcherGui::TaskSketcherMessages::slotSetUp, this, sp::_1, sp::_2, sp::_3, sp::_4));
//NOLINTEND
ui->labelConstrainStatus->setOpenExternalLinks(false);

View File

@@ -3232,10 +3232,12 @@ bool ViewProviderSketch::setEdit(int ModNum)
// a draw(true) via ViewProvider::UpdateData.
getSketchObject()->solve(true);
//NOLINTBEGIN
connectUndoDocument = getDocument()->signalUndoDocument.connect(
std::bind(&ViewProviderSketch::slotUndoDocument, this, sp::_1));
connectRedoDocument = getDocument()->signalRedoDocument.connect(
std::bind(&ViewProviderSketch::slotRedoDocument, this, sp::_1));
//NOLINTEND
// Enable solver initial solution update while dragging.
getSketchObject()->setRecalculateInitialSolutionWhileMovingPoint(