My question is: How to check whether or not a connection exists in Qt when the slot is a lambda function?
I have the following code snippet
connect(item1, &Item::somethingChanged, this, [this](){ doSomething(m_someObject1, 2); }, Qt::DirectConnection);
connect(item2, &Item::somethingChanged, this, [this](){ doSomething(m_someObject2, 5); }, Qt::DirectConnection);
I want to check whether or not this connection exists within my GoogleTest:
ASSERT_FALSE(QObject::connect(item1, &Item::somethingChanged, this, [this](){ doSomething(m_someObject1, 2); }, Qt::UniqueConnection));
This however, does not work because the lambda slot is considered to be a different lambda than the one I connected within my class itself. How would I go about checking whether this connection exists?