PDA

View Full Version : QThread: Move owner of thread to thread with moveToThread



SepticInsect
3rd September 2012, 13:39
Hi,
is it ok to move the object owning the thread to the thread? Like in the example below.

a.h:
QThread* m_pThread;

a.cpp:
m_pThread = new QThread;
this->moveToThread(m_pThread);

Thanks!

high_flyer
4th September 2012, 14:13
This probably can be done, but why do you need this construct?
You probably have a design problem if you need this.
Instead of this, check QRunnable.