dorik
8th July 2011, 23:10
Hello,
I am trying to use invokeMethod from the main thread on the slot of a QThread subclass which is running an event loop.
QMetaObject::invokeMethod(myThread, "mySlot", Qt::QueuedConnection, Q_ARG(const SomeObject&, obj));
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!
I am trying to use invokeMethod from the main thread on the slot of a QThread subclass which is running an event loop.
QMetaObject::invokeMethod(myThread, "mySlot", Qt::QueuedConnection, Q_ARG(const SomeObject&, obj));
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!