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 292196a606
commit d150fa7164
80 changed files with 240 additions and 30 deletions

View File

@@ -91,11 +91,13 @@ void ViewProviderBody::attach(App::DocumentObject *pcFeat)
assert ( adoc );
assert ( gdoc );
//NOLINTBEGIN
connectChangedObjectApp = adoc->signalChangedObject.connect (
std::bind ( &ViewProviderBody::slotChangedObjectApp, this, sp::_1, sp::_2) );
connectChangedObjectGui = gdoc->signalChangedObject.connect (
std::bind ( &ViewProviderBody::slotChangedObjectGui, this, sp::_1, sp::_2) );
//NOLINTEND
}
// TODO on activating the body switch to the "Through" mode (2015-09-05, Fat-Zer)
@@ -131,7 +133,9 @@ void ViewProviderBody::setupContextMenu(QMenu* menu, QObject* receiver, const ch
Q_UNUSED(member);
Gui::ActionFunction* func = new Gui::ActionFunction(menu);
QAction* act = menu->addAction(tr("Toggle active body"));
func->trigger(act, std::bind(&ViewProviderBody::doubleClicked, this));
func->trigger(act, [this]() {
this->doubleClicked();
});
Gui::ViewProviderGeometryObject::setupContextMenu(menu, receiver, member); // clazy:exclude=skipped-base-method
}