One way to do it is to have a worker object and move it to a QThread
Worker *worker = new Worker(); // class derived from QObject
worker->moveToThread(thread);
connect(thread, SIGNAL(started()), worker, SLOT(start())); // Worker needs a slot that start the work
thread->start();
Worker *worker = new Worker(); // class derived from QObject
QThread *thread = new QThread();
worker->moveToThread(thread);
connect(thread, SIGNAL(started()), worker, SLOT(start())); // Worker needs a slot that start the work
thread->start();
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks