bool MainWorker::eventFilter(QObject *obj, QEvent *event){ if (event->type() == QEvent::MetaCall) { QMetaCallEvent* metaEvent = static_cast<QMetaCallEvent*>(event); if (nullptr != dynamic_cast<const InputWorker*>(metaEvent->sender())) { ++m_queueCounter; } else if (nullptr != dynamic_cast<const OutputWorker*>(metaEvent->sender())) { if (--m_queueCounter == 0); emit imFreeForJob(); } }}