modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 --------------------------------------------------- */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user