I'm trying to run a public slot in another thread using invokeMethod
:
QMetaObject::invokeMethod(m_manager, "onEventRequest", Qt::QueuedConnection, Q_ARG(int, 0));
Now, invokeMethod
returns true and no error message are reported, but the slot onEventRequest
is never called. I added a breakpoint in onEventRequest
which is never triggered.
m_manager
is created in the main thread, this class inherits QObject
and uses the Q_OBJECT
macro invokeMethod
is executed in another thread created by QThread::run()
.
I would appreciate any help on this, or on how to check why the method is not being called.