Hello,

I am trying to use invokeMethod from the main thread on the slot of a QThread subclass which is running an event loop.

Qt Code:
  1. QMetaObject::invokeMethod(myThread, "mySlot", Qt::QueuedConnection, Q_ARG(const SomeObject&, obj));
To copy to clipboard, switch view to plain text mode 

However, outputting QThread::currentThreadId() inside the slot shows that it executes in the main thread. Does anyone know what the problem is? I would prefer not to connect a signal to the slot.

Thanks!