I have two signals which are NOT necessarily received at the same time.
First signal
First signal is emitted by MyClass
and is handled by a slot of MyClass
:
QObject::connect(this, &MyClass::ready,
this, &MyClass::handleReady);
void MyClass::handleReady()
{
qDebug() << "Ready to do next step";
}
// ... somewhere in MyClass implementation, signal is emitted:
emit ready();
Second signal
Second signal is emitted by a member object and is handled by a slot of MyClass
:
QObject::connect(m_member, &MemberClass::enabledChanged,
this, &MyClass::handleEnabledChange);
//...
void MyClass::handleEnabledChange(const bool enabled)
{
qDebug() << "Is member enabled?" << enabled;
}
I intend to run some code (like a function), depending upon two condition:
- First signal, i.e.
ready
is received - Second signal, i.e.
enabledChanged
, is received and its Boolean parameter istrue
I cannot figure out how to check for satisfaction of above conditions.
UPDATE
Now my signals count is increased to three. So my code execution depends on three conditions.