[Qt-interest] emit signal from spawned thread

Cole, Derek dcole at integrity-apps.com
Thu Aug 18 23:01:40 CEST 2011


Hello, I am running a particular method with Qt::Concurrent run

I want to emit a signal from that thread to run a method to print some progress. In my loop i have


emit tileLoaded(progInt);

In the constructor for the class that is spawning the new thread, and which also contains this worker method, I have

connect(this, SIGNAL(tileLoaded(int)), this, SLOT(printProgress(int)));

And that worker method is being spawned in a different thread via Qt::concurrentRun()

For some reason, it doesnt seem like my slot ever gets called.  I have tried actually putting the connection code in the worker method too, so that the connection between signal and slot is made in the same thread that the signal is emitted, but it didnt seem to work either.

How can I make this work?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110818/0c3bd3e8/attachment.html 


More information about the Qt-interest-old mailing list