error: unknown type name ‘Q_DECLARE_METATYPE‘

Recently, when developing with QT4, there was a problem that Q could not be recognized_ DECLARE_ The error code of the metatype macro was transplanted from Qt5. I thought it was not supported by QT4. After checking later, I found that the qmetatype. H header file must be included in QT4, and only qvariant needs to be included in Qt5.


Read More: