今天在测试多线程时定义一个类 继承QTHread 结果包含QT Object 造成QT 构造函数失败

#ifndefTHREAD_H
#defineTHREAD_H
#include<QThread>
#include<iostream>
#include<QObject>
//classmythread:publicQThread
classmythread:publicQThread
{
//Q_OBJECT (未继承object 而是使用这个宏 )
public:

//thread();
mythread();
~mythread();
voidsetMessage(QStringmessage);
voidstop();

protected:
voidrun();
voidprintMessage();

private:
QStringmessageStr;
volatileboolstopped;


};

#endif//THREAD_H



去掉立即正常