#include<b.h>class a : public QWidget{ Q_OBJECTpublic: a(QWidget *parent = 0);private: void show(int pos); };
#include "a.h"void a::show(int pos){ th j; j.run(pos);}
#include <QThread>#include<a.h>class th : public QThread{ Q_OBJECTpublic: explicit th(QObject *parent = 0); void run(int h);};
#include "th.h"th::th(QObject *parent) : QThread(parent){}void th::run(int h){ ...}
#include "a.h"th *j;void a::show(int pos){ j = new th(); j->pos = pos; j->start();}
QThread thread;Worker worker;connect(obj, SIGNAL(workReady()), &worker, SLOT(doWork()));worker.moveToThread(&thread);thread.start();