I have a custom metatype declared as shown below -
class thumbnaildata
: public QObject{
Q_OBJECT
public:
thumbnaildata(); //default ctor
thumbnaildata
( QPixmap aPixmap,
QString aPmapFilePath
);
//ctor with parameters thumbnaildata( const thumbnaildata& other ); //mandatory copy ctor
~thumbnaildata();
void setFilePath
( QString aPmapFilePath
);
private:
};
Q_DECLARE_METATYPE( thumbnaildata )
class thumbnaildata : public QObject
{
Q_OBJECT
public:
thumbnaildata(); //default ctor
thumbnaildata( QPixmap aPixmap,QString aPmapFilePath ); //ctor with parameters
thumbnaildata( const thumbnaildata& other ); //mandatory copy ctor
~thumbnaildata();
void setPixmap( QPixmap aPixmap );
void setFilePath( QString aPmapFilePath );
QPixmap getPmap();
QString getPmapFilePath();
private:
QPixmap mMypixmap;
QString mPixmapFilePath;
};
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 ?
Bookmarks