由于没有继承QObject类而引起的

只需继承QObject类即可

Qt error C2338: No Q_OBJECT in the class with the signal错误解决办法(无法编译过信号与槽)-LMLPHP
如果已经继承了QObject类,编译还出现错误

将QObject类放在最前面继承:public QObject

Qt error C2338: No Q_OBJECT in the class with the signal错误解决办法(无法编译过信号与槽)-LMLPHP

最后即可编译通过

05-13 09:55