Unsolved Catch signal with lambda expression
-
Hi guys,
Why does that workQPushButton *butOK = new QPushButton("OK"); connect(butOK, &QPushButton::clicked, [=]() { ... });
But this
QSpinBox *spinMin = new QSpinBox(); connect(spinMin, &QSpinBox::valueChanged, [=]() {butOK->setEnabled(true);});
does not work?? The compiler complains
"No matching function for call to connect(QSpinBox*&, <unresolved overloaded function type>, function()::<lambda(QVariant)>::lambda()>)" ,
but that sounds very cryptic to me.
Is it possible to catch QSpinBox::valueChanged with a lambda? -
-
Great!! It works!! Thanks a lot
-
@Stephan-Lorenzen Please mark the topic as solved then.