class myThread:public QThread { signals: void updateSig(MyData); } void myThread::run() { emit updateSig(MyData); } class MainWid:public MainWindow { myThread *thread; public slots: void updateSlot(MyData); } MainWid:MainWid() { thread=new myThread; qRegisterMetaType<MyData>("MyData");//自定义数据类型需要进行注册 connect(thread,SIGNAL(updateSig(MyData)),this,SLOT(updateSlot(MyData))); }