modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -111,8 +111,10 @@ public:
|
||||
|
||||
private:
|
||||
FemPostObjectSelectionObserver() {
|
||||
//NOLINTBEGIN
|
||||
this->connectSelection = Gui::Selection().signalSelectionChanged.connect(
|
||||
std::bind(&FemPostObjectSelectionObserver::selectionChanged, this, sp::_1));
|
||||
//NOLINTEND
|
||||
}
|
||||
|
||||
~FemPostObjectSelectionObserver() = default;
|
||||
|
||||
Reference in New Issue
Block a user