Signal and slot in different threads
-
Hi,
I have object A which has signal and slot. I need to execute IOCTL to device asynchronously. I use QConcurrent:: run for this. After the ioctl is completed, i emit a signal. The connection of signal and slot is with default connection type. But the slot is never invoked. The slot is invoked only if i specify direct connection.
@
connect(this, SIGNAL(signal_xyz(int)), this SLOT(slot_xyz(int));
QConcurrent:run(this,&Class_Name::function_name, param1,param2);
@
The threadpool::globalinstance->setmaxthread is set to 10.i saw a similar post which tells to use qMetaObject::invokemethod. But even with that, the slot is called only if connection is directconnection.
In my case, the fist IOCTL will take sometime, the 2nd IOCTL finishes before 1st completes. In this case, the slot is always called in the order of execution rather than the order of reply from the device.