Results 1 to 2 of 2

Thread: Problem in compilation with custom metatype

  1. #1
    Join Date
    May 2010
    Posts
    46
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Question Problem in compilation with custom metatype

    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 ?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem in compilation with custom metatype

    Please show us the line which cause that error.

Similar Threads

  1. QwtPlot3D compilation problem
    By gutiory in forum Qwt
    Replies: 2
    Last Post: 19th January 2012, 06:41
  2. How to add metatype support for QMap<int,QVariant>?
    By makinenh in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2010, 16:15
  3. sub-dir compilation problem
    By Salazaar in forum Newbie
    Replies: 13
    Last Post: 2nd November 2007, 21:48
  4. qt4 compilation problem
    By aegis in forum Installation and Deployment
    Replies: 9
    Last Post: 22nd February 2007, 23:10
  5. Compilation problem, don't know why
    By yellowmat in forum Newbie
    Replies: 6
    Last Post: 2nd March 2006, 15:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.