Suppose, there is a lambda connected to a signal
as below:
connect(pObject, &Object::mySignal, [] () { lambda; });
Will below statement disconnect the lambda automatically?
disconnect(pObject, &Object::mySignal, nullptr, nullptr);
I am asking this, because in the QObject::disconnect
's documents there are 2 contradicting statements:
2 Disconnect everything connected to a specific signal:
disconnect(myObject, SIGNAL(mySignal()), nullptr, nullptr);
and
Note: It is not possible to use this overload to disconnect signals connected to functors or lambda expressions. That is because it is not possible to compare them. Instead, use the overload that takes a QMetaObject::Connection`