Qt error C2338: No Q_OBJECT in the class with the signal error solutions (not compiled signals and slots)

Because the class does not inherit QObject caused

Just like you can inherit QObject

Here Insert Picture Description
If you have inherited the QObject class, the compiler error also appeared

Will inherit QObject class up front: public QObject

Here Insert Picture Description

Finally, you can compile

Guess you like

Origin www.cnblogs.com/ybqjymy/p/12299598.html