So I have some sample code below.
workerThread = new QThread();
m_worker->moveToThread( workerThread );
connect( workerThread , SIGNAL( started() ), m_worker, SLOT( createObject() ) );
connect( m_worker, SIGNAL( created() ), this, SLOT( objectReceived() ) );
workerThread->start();
It currently uses a QThread by initializing it with new. If this is the only context it is used in, couldn't I just use "QThread workerThread", reference its address for connection, and be done? This would save the program from putting the thread on the heap. I noticed if I don't use new and use the way I listed, I get the following error "QThread: Destroyed while thread is still running". Nothing changed in the code except the changes I listed. If I use new I do not get this error. Is there a significant difference?