PDA

View Full Version : QT thread classes quidance requested



bajarangi
26th May 2009, 13:56
Hi all,

I am fairly new to QT, but posting here because threading is not typically a n00b question.

I've read all the QT4 docs, tutorials, and examples on the new threading classes.

What I need is to simply run a function or class in a thread, and I'd really like to use
signals and slots to get some results back from the class.

I initially tried to use QtConcurrent and QRunnable, but neither one would compile
if I used Q_OBJECT in the class definition. After investigating the QT Object model
and such, it appears that neither will work, due to those classes needing a copy constructor
when invoking the thread.

Am I correct in this, or is there a special class construction that will let me use signals and slots with QtConcurrent or QRunnable?

Is it correct that I am limited to QThread if I want to use signals and slots?

NB: I'd really, really like to use QThreadPool, but it only supports QRunnable - dang.:crying:

-Don