[Qt-interest] emit signal from spawned thread
Jason H
scorp1us at yahoo.com
Fri Aug 19 20:30:17 CEST 2011
Your QRunnable::run() would need some way to identify its signal target, and then it could connect() in the run.
I would try inheriting from QRunnable and have a setSignalTarget(QObject*) wherein it could in run() {
connect(this, mysignal, target, slot)
}
It's the same trick used in making TCP servers multithreaded, where you set the socketDescriptor (an int) then in the run, you pick up that descriptor and run with it, pun partially intented.
________________________________
From: Guido Seifert <wargand at gmx.de>
To: TrolltechInterest <qt-interest at trolltech.com>
Sent: Friday, August 19, 2011 2:10 PM
Subject: Re: [Qt-interest] emit signal from spawned thread
> > automatic connections, but you should be able to emit your own signals.
>
> You can emit signals from anywhere.
Sure. But du you see a way to connect to a signal emitted from a
function passed to QtConcurrent::run?
Guido
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110819/79ed2260/attachment.html
More information about the Qt-interest-old
mailing list