Passing an argument to a slot

With Qt 5 and a C++11 compiler, the idiomatic way to do such things is to give a functor to connect: connect(action1, &QAction::triggered, this, [this]{ onStepIncreased(1); }); connect(action5, &QAction::triggered, this, [this]{ onStepIncreased(5); }); connect(action10, &QAction::triggered, this, [this]{ onStepIncreased(10); }); connect(action25, &QAction::triggered, this, [this]{ onStepIncreased(25); }); connect(action50, &QAction::triggered, this, [this]{ onStepIncreased(50); }); The third argument to … Read more