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

@@ -161,7 +161,9 @@ void ViewProviderFemAnalysis::setupContextMenu(QMenu *menu, QObject *, const cha
{
Gui::ActionFunction *func = new Gui::ActionFunction(menu);
QAction *act = menu->addAction(tr("Activate analysis"));
func->trigger(act, std::bind(&ViewProviderFemAnalysis::doubleClicked, this));
func->trigger(act, [this](){
this->doubleClicked();
});
}
bool ViewProviderFemAnalysis::setEdit(int ModNum)

View File

@@ -69,10 +69,12 @@ namespace sp = std::placeholders;
void FunctionWidget::setViewProvider(ViewProviderFemPostFunction* view)
{
//NOLINTBEGIN
m_view = view;
m_object = static_cast<Fem::FemPostFunction*>(view->getObject());
m_connection = m_object->getDocument()->signalChangedObject.connect(
std::bind(&FunctionWidget::onObjectsChanged, this, sp::_1, sp::_2));
//NOLINTEND
}
void FunctionWidget::onObjectsChanged(const App::DocumentObject& obj, const App::Property& p) {

View File

@@ -111,8 +111,10 @@ public:
private:
FemPostObjectSelectionObserver() {
//NOLINTBEGIN
this->connectSelection = Gui::Selection().signalSelectionChanged.connect(
std::bind(&FemPostObjectSelectionObserver::selectionChanged, this, sp::_1));
//NOLINTEND
}
~FemPostObjectSelectionObserver() = default;