I have a custom metatype declared as shown below -

Qt Code:
  1. class thumbnaildata : public QObject
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. thumbnaildata(); //default ctor
  7. thumbnaildata( QPixmap aPixmap,QString aPmapFilePath ); //ctor with parameters
  8. thumbnaildata( const thumbnaildata& other ); //mandatory copy ctor
  9.  
  10. ~thumbnaildata();
  11.  
  12. void setPixmap( QPixmap aPixmap );
  13. void setFilePath( QString aPmapFilePath );
  14.  
  15. QPixmap getPmap();
  16. QString getPmapFilePath();
  17.  
  18. private:
  19. QPixmap mMypixmap;
  20. QString mPixmapFilePath;
  21.  
  22. };
  23.  
  24. Q_DECLARE_METATYPE( thumbnaildata )
To copy to clipboard, switch view to plain text mode 

When I compile this definition & use it in a model class ( compatible with QVariant ), I am getting the following error -

" Error: #145: member "thumbnaildata::staticMetaObject" may not be initialized
const QMetaObject thumbnaildata::staticMetaObject = { "

What is the issue & has anyone faced this issue before ?