[Qt-interest] Signal delivery question, across threads

Patric userqt at gmail.com
Sun Jun 7 00:30:15 CEST 2009


Hello, 
I have some tabs here. I want to have worker thread for each tab, so the GUI will not freeze. For example, in the thread class of the first tab (i.e. ConfigTab)I have some slots which I want to be exected from the worker thread, when I click on some button in the tab. 
The thread have event loop. 

I connected the Signal with the slot from the thread, but I realized that in fact the slot is executed from the main thread... and of course, the worker thread lives in the main thread. 
So I'm considering moving the slot to another class, lets say "ConfigTabManager". And this class will be initialized in the worker thread. I think it should do the things. 

So, I want to ask you, is there any better solution that this ? In which I can leave the slot in the thread and just say "Look, I want you to let the execution of this slot to the worker thread, not to the main thread". 

Thank you 

Patric


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090607/1261d8be/attachment.html 


More information about the Qt-interest-old mailing list