[Qt-interest] connection between qthreads blocks my gui

franki franki at franki.eu.org
Tue Dec 14 19:25:03 CET 2010


Hi all,

I have some gui class (mainClass), inside that class I created two classes 
which subclass QThread, one of which is sending/receiving data from rs232, 
lets say rs232Thread, second one is sending signal to start reading from 
rs232,lets say cronThread. Connection is defined inside mainClass like this:
connect(cronThread,SIGNAL(startChecking()),rs232Thread,SLOT(readWrite()),Qt::QueuedConnection)

Problem is, that this readWrite function blocks my entire gui when running, 
and as I read somewhere in case of QueuedConnection, the SLOT is executed 
inside receiver's thread, so why is this blocking my gui?

The only way I can do it without blocking gui is to place function readWrite 
inside run() of this rs232Thread and connect signal from cronThread to some 
function (defined in rs232Thread) which starts run(). 

What am I doing wrong? Is this a problem that connection between this two 
threads is defined inside mainClass (which is gui thread) ? Or there is 
something else?

please help.

best regards
Marek 



More information about the Qt-interest-old mailing list